Типовые функции

Типы функций

Имя Описание
TYPE Возвращает тип значения в виде STRING .

ТИП

Синтаксис:

type(input: ANY) -> STRING

Описание:

Возвращает строковое представление input типа.

Если задано отсутствующее значение, возвращает NULL .

Примеры:

input type(input)
НУЛЕВОЙ "нулевой"
истинный "булевый"
1 "int32"
-3 л "int64"
3.14 "float64"
2024-01-01T00:00:00Z UTC "временная метка"
"фу" "нить"
б"фу" "байты"
[1, 2] "множество"
{"а": 1} "карта"
path("c/d") "ссылка"
vector([1.0, 2.0]) "вектор"
ОТСУТСТВУЮЩИЙ НУЛЕВОЙ

Примеры клиентов

Node.js
const result = await db.pipeline()
  .collection("books")
  .select(field("title").notEqual("1984").as("not1984"))
  .execute();

Web

const result = await execute(db.pipeline()
  .collection("books")
  .select(field("title").notEqual("1984").as("not1984"))
);
Быстрый
let result = try await db.pipeline()
  .collection("books")
  .select([Field("title").notEqual("1984").as("not1984")])
  .execute()

Kotlin

val result = db.pipeline()
    .collection("books")
    .select(field("title").notEqual("1984").alias("not1984"))
    .execute()

Java

Task<Pipeline.Snapshot> result = db.pipeline()
    .collection("books")
    .select(field("title").notEqual("1984").alias("not1984"))
    .execute();
Python
from google.cloud.firestore_v1.pipeline_expressions import Field

result = (
    client.pipeline()
    .collection("books")
    .select(Field.of("title").not_equal("1984").as_("not1984"))
    .execute()
)
Java
Pipeline.Snapshot result =
    firestore
        .pipeline()
        .collection("books")
        .select(notEqual(field("title"), "1984").as("not1984"))
        .execute()
        .get();