ফাংশন লিখুন

ফাংশন টাইপ করুন

নাম বিবরণ
TYPE STRING হিসেবে ভ্যালুর ধরন দেখায়।
IS_TYPE ভ্যালু নির্দিষ্ট ধরনের সাথে মিললে true দেখায়।

প্রকার

সিনট্যাক্স:

type(input: ANY) -> STRING

বিবরণ:

input ধরনের স্ট্রিং উপস্থাপনা দেখায়।

অনুপস্থিত ভ্যালু দেওয়া হলে, NULL দেখায়।

উদাহরণ:

input type(input)
NULL "null"
সত্য "boolean"
1 "int32"
-৩L "int64"
৩.১৪ "float64"
2024-01-01T00:00:00Z UTC "timestamp"
"foo" "string"
b"foo" "bytes"
[১, ২] "array"
{"a": 1} "map"
path("c/d") "reference"
vector([1.0, 2.0]) "vector"
object_id "a7f2c9d18b3e4509f67c12d8" "object_id"
1.2e9m "decimal128"
regex "/pattern/i" "regex"
bson_timestamp(1732754912, 500) "bson_timestamp"
অনুপস্থিত NULL

ক্লায়েন্টের উদাহরণ

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"))
);
Swift
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()
)
জাভা
Pipeline.Snapshot result =
    firestore
        .pipeline()
        .collection("books")
        .select(notEqual(field("title"), "1984").as("not1984"))
        .execute()
        .get();
Go
snapshot := client.Pipeline().
	Collection("books").
	Select(firestore.Fields(
		firestore.NotEqual(firestore.FieldOf("title"), "1984").As("not1984"),
	)).
	Execute(ctx)

IS_TYPE

সিনট্যাক্স:

is_type(input: ANY, type: STRING) -> BOOLEAN

বিবরণ:

input নির্দিষ্ট করা type-এর সাথে মিললে true রিটার্ন করে, অন্যথায় false রিটার্ন করে। অনুপস্থিত input দেওয়া হলে, NULL রিটার্ন করে।

কাজ করে এমন type স্ট্রিং হল:

  • "null"
  • "boolean"
  • "int32"
  • "int64"
  • "float64"
  • "decimal128"
  • "number"
  • "timestamp"
  • "string"
  • "bytes"
  • "array"
  • "map"
  • "reference"
  • "vector"
  • "geo_point"
  • "max_key"
  • "min_key"
  • "object_id"
  • "regex"
  • "bson_timestamp"

উদাহরণ:

input type is_type(input, type)
NULL "null" সত্য
সত্য "বুলিয়ান" সত্য
৩.১৪ "float64" সত্য
"foo" "স্ট্রিং" সত্য
b"foo" "স্ট্রিং" মিথ্যা
[১, ২] "অ্যারে" সত্য
{"a": 1} "ম্যাপ" সত্য
vector([1.0, 2.0]) "ভেক্টর" সত্য
অনুপস্থিত "স্ট্রিং" NULL
"বার" "অন্য" সমস্যা