স্ট্রিং ফাংশন

স্ট্রিং ফাংশন

নাম বিবরণ
BYTE_LENGTH STRING বা BYTES ভ্যালুতে BYTES-এর সংখ্যা দেখায়
CHAR_LENGTH STRING মানে ইউনিকোড অক্ষরের সংখ্যা দেখায়
STARTS_WITH STRING প্রদত্ত প্রিফিক্স দিয়ে শুরু হলে TRUE রিটার্ন করে
ENDS_WITH প্রদত্ত পোস্টফিক্স দিয়ে STRING শেষ হলে TRUE রিটার্ন করে
LIKE STRING কোনও প্যাটার্নের সাথে ম্যাচ করলে TRUE রিটার্ন করে
REGEX_CONTAINS কোনও ভ্যালু রেগুলার এক্সপ্রেশনের সাথে আংশিক বা সম্পূর্ণভাবে মিলে গেলে TRUE রিটার্ন করে
REGEX_FIND রেগুলার এক্সপ্রেশনের সাথে ম্যাচ করে এমন প্রথম সাবস্ট্রিং বা কোনও ম্যাচ না থাকলে NULL রিটার্ন করে।
REGEX_FIND_ALL রেগুলার এক্সপ্রেশনের সাথে মেলে এমন সব সাবস্ট্রিংয়ের অ্যারে অথবা কোনও মিল না থাকলে খালি অ্যারে দেখায়।
REGEX_MATCH কোনও ভ্যালুর যেকোনও অংশ রেগুলার এক্সপ্রেশনের সাথে মিললে TRUE রিটার্ন করে
STRING_CONCAT একাধিক STRING-কে একটি STRING-এ কনক্যাটিনেট করে
STRING_CONTAINS কোনও ভ্যালুতে STRING থাকলে TRUE রিটার্ন করে
STRING_INDEX_OF STRING বা BYTES ভ্যালুর প্রথম ঘটনার ০-ভিত্তিক ইন্ডেক্স রিটার্ন করে।
TO_UPPER STRING বা BYTES ভ্যালু বড় হাতের অক্ষরে কনভার্ট করে।
TO_LOWER STRING বা BYTES ভ্যালুকে ছোট হাতের অক্ষরে কনভার্ট করে।
SUBSTRING STRING বা BYTES ভ্যালুর সাবস্ট্রিং পায়।
STRING_REVERSE STRING বা BYTES ভ্যালু রিভার্স করে।
STRING_REPEAT নির্দিষ্ট সংখ্যক বার STRING বা BYTES মান রিপিট করে।
STRING_REPLACE_ALL STRING বা BYTES ভ্যালুর সব ঘটনা পরিবর্তন করে।
STRING_REPLACE_ONE STRING বা BYTES ভ্যালুর প্রথম ঘটনাকে প্রতিস্থাপন করে।
TRIM STRING বা BYTES ভ্যালু থেকে প্রথম ও শেষের অক্ষর ট্রিম করে।
LTRIM STRING বা BYTES ভ্যালু থেকে প্রথমের অক্ষর ট্রিম করে।
RTRIM STRING বা BYTES ভ্যালু থেকে ট্রেলিং অক্ষর ট্রিম করে।
SPLIT STRING বা BYTES ভ্যালুকে একটি অ্যারেতে স্প্লিট করে।

BYTE_LENGTH

সিনট্যাক্স:

byte_length[T <: STRING | BYTES](value: T) -> INT64

বিবরণ:

STRING বা BYTES মানে BYTES-এর সংখ্যা দেখায়।

উদাহরণ:

মান byte_length(value)
"abc" 3
"xyzabc" 6
b"abc" 3
Node.js
const result = await db.pipeline()
  .collection("books")
  .select(
    field("title").byteLength().as("titleByteLength")
  )
  .execute();

Web

const result = await execute(db.pipeline()
  .collection("books")
  .select(
    field("title").byteLength().as("titleByteLength")
  )
);
Swift
let result = try await db.pipeline()
  .collection("books")
  .select([
    Field("title").byteLength().as("titleByteLength")
  ])
  .execute()

Kotlin

val result = db.pipeline()
    .collection("books")
    .select(
        field("title").byteLength().alias("titleByteLength")
    )
    .execute()

Java

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

result = (
    client.pipeline()
    .collection("books")
    .select(Field.of("title").byte_length().as_("titleByteLength"))
    .execute()
)
জাভা
Pipeline.Snapshot result =
    firestore
        .pipeline()
        .collection("books")
        .select(byteLength(field("title")).as("titleByteLength"))
        .execute()
        .get();
Go
snapshot := client.Pipeline().
	Collection("books").
	Select(firestore.Fields(
		firestore.ByteLength(firestore.FieldOf("title")).As("titleByteLength"),
	)).
	Execute(ctx)

CHAR_LENGTH

সিনট্যাক্স:

char_length(value: STRING) -> INT64

বিবরণ:

STRING ভ্যালুতে ইউনিকোড কোড পয়েন্টের সংখ্যা দেখায়।

উদাহরণ:

মান char_length(value)
"abc" 3
"হ্যালো" 5
"বিশ্ব" 5
Node.js
const result = await db.pipeline()
  .collection("books")
  .select(
    field("title").charLength().as("titleCharLength")
  )
  .execute();

Web

const result = await execute(db.pipeline()
  .collection("books")
  .select(
    field("title").charLength().as("titleCharLength")
  )
);
Swift
let result = try await db.pipeline()
  .collection("books")
  .select([
    Field("title").charLength().as("titleCharLength")
  ])
  .execute()

Kotlin

val result = db.pipeline()
    .collection("books")
    .select(
        field("title").charLength().alias("titleCharLength")
    )
    .execute()

Java

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

result = (
    client.pipeline()
    .collection("books")
    .select(Field.of("title").char_length().as_("titleCharLength"))
    .execute()
)
জাভা
Pipeline.Snapshot result =
    firestore
        .pipeline()
        .collection("books")
        .select(charLength(field("title")).as("titleCharLength"))
        .execute()
        .get();
Go
snapshot := client.Pipeline().
	Collection("books").
	Select(firestore.Fields(
		firestore.CharLength(firestore.FieldOf("title")).As("titleCharLength"),
	)).
	Execute(ctx)

STARTS_WITH

সিনট্যাক্স:

starts_with(value: STRING, prefix: STRING) -> BOOLEAN

বিবরণ:

value, prefix দিয়ে শুরু হলে TRUE ফেরত পাঠায়।

উদাহরণ:

মান উপসর্গ starts_with(value, prefix)
"abc" "a" সত্য
"abc" "b" মিথ্যা
"abc" "" সত্য
Node.js
const result = await db.pipeline()
  .collection("books")
  .select(
    field("title").startsWith("The")
      .as("needsSpecialAlphabeticalSort")
  )
  .execute();

Web

const result = await execute(db.pipeline()
  .collection("books")
  .select(
    field("title").startsWith("The")
      .as("needsSpecialAlphabeticalSort")
  )
);
Swift
let result = try await db.pipeline()
  .collection("books")
  .select([
    Field("title").startsWith("The")
      .as("needsSpecialAlphabeticalSort")
  ])
  .execute()

Kotlin

val result = db.pipeline()
    .collection("books")
    .select(
        field("title").startsWith("The")
            .alias("needsSpecialAlphabeticalSort")
    )
    .execute()

Java

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

result = (
    client.pipeline()
    .collection("books")
    .select(
        Field.of("title").starts_with("The").as_("needsSpecialAlphabeticalSort")
    )
    .execute()
)
জাভা
Pipeline.Snapshot result =
    firestore
        .pipeline()
        .collection("books")
        .select(startsWith(field("title"), "The").as("needsSpecialAlphabeticalSort"))
        .execute()
        .get();
Go
snapshot := client.Pipeline().
	Collection("books").
	Select(firestore.Fields(
		firestore.StartsWith(firestore.FieldOf("title"), "The").As("needsSpecialAlphabeticalSort"),
	)).
	Execute(ctx)

ENDS_WITH

সিনট্যাক্স:

ends_with(value: STRING, postfix: STRING) -> BOOLEAN

বিবরণ:

value, postfix দিয়ে শেষ হলে TRUE রিটার্ন করে।

উদাহরণ:

মান পোস্টফিক্স ends_with(value, postfix)
"abc" "c" সত্য
"abc" "b" মিথ্যা
"abc" "" সত্য
Node.js
const result = await db.pipeline()
  .collection("inventory/devices/laptops")
  .select(
    field("name").endsWith("16 inch")
      .as("16InLaptops")
  )
  .execute();
Swift
let result = try await db.pipeline()
  .collection("inventory/devices/laptops")
  .select([
    Field("name").endsWith("16 inch")
      .as("16InLaptops")
  ])
  .execute()

Kotlin

val result = db.pipeline()
    .collection("inventory/devices/laptops")
    .select(
        field("name").endsWith("16 inch")
            .alias("16InLaptops")
    )
    .execute()

Java

Task<Pipeline.Snapshot> result = db.pipeline()
    .collection("inventory/devices/laptops")
    .select(
        field("name").endsWith("16 inch")
            .alias("16InLaptops")
    )
    .execute();
Python
from google.cloud.firestore_v1.pipeline_expressions import Field

result = (
    client.pipeline()
    .collection("inventory/devices/laptops")
    .select(Field.of("name").ends_with("16 inch").as_("16InLaptops"))
    .execute()
)
জাভা
Pipeline.Snapshot result =
    firestore
        .pipeline()
        .collection("inventory/devices/laptops")
        .select(endsWith(field("name"), "16 inch").as("16InLaptops"))
        .execute()
        .get();
Go
snapshot := client.Pipeline().
	Collection("inventory/devices/laptops").
	Select(firestore.Fields(
		firestore.EndsWith(firestore.FieldOf("name"), "16 inch").As("`Laptops16in`"),
	)).
	Execute(ctx)

পছন্দ করুন

সিনট্যাক্স:

like(value: STRING, pattern: STRING) -> BOOLEAN

বিবরণ:

value-এর সাথে pattern-এর মিল থাকলে TRUE রিটার্ন করে।

উদাহরণ:

মান প্যাটার্ন like(value, pattern)
"Firestore" "আগুন%" সত্য
"Firestore" "%store" সত্য
"Datastore" "Data_tore" সত্য
"১০০%" "১০০\%" সত্য
Node.js
const result = await db.pipeline()
  .collection("books")
  .select(
    field("genre").like("%Fiction")
      .as("anyFiction")
  )
  .execute();

Web

const result = await execute(db.pipeline()
  .collection("books")
  .select(
    field("genre").like("%Fiction")
      .as("anyFiction")
  )
);
Swift
let result = try await db.pipeline()
  .collection("books")
  .select([
    Field("genre").like("%Fiction")
      .as("anyFiction")
  ])
  .execute()

Kotlin

val result = db.pipeline()
    .collection("books")
    .select(
        field("genre").like("%Fiction")
            .alias("anyFiction")
    )
    .execute()

Java

Task<Pipeline.Snapshot> result = db.pipeline()
    .collection("books")
    .select(
        field("genre").like("%Fiction")
            .alias("anyFiction")
    )
    .execute();
Python
from google.cloud.firestore_v1.pipeline_expressions import Field

result = (
    client.pipeline()
    .collection("books")
    .select(Field.of("genre").like("%Fiction").as_("anyFiction"))
    .execute()
)
জাভা
Pipeline.Snapshot result =
    firestore
        .pipeline()
        .collection("books")
        .select(like(field("genre"), "%Fiction").as("anyFiction"))
        .execute()
        .get();
Go
snapshot := client.Pipeline().
	Collection("books").
	Select(firestore.Fields(
		firestore.Like(firestore.FieldOf("genre"), "%Fiction").As("anyFiction"),
	)).
	Execute(ctx)

REGEX_CONTAINS

সিনট্যাক্স:

regex_contains(value: STRING, regexp: STRING | REGEX) -> BOOLEAN

বিবরণ:

value-এর কোনও অংশ regexp-এর সাথে ম্যাচ করলে TRUE রিটার্ন করে। regexp সঠিক রেগুলার এক্সপ্রেশন না হলে, এই ফাংশন error রিটার্ন করে।

regexp আর্গুমেন্টটি REGEX ভ্যালুও হতে পারে যা regex("pattern", "options") ব্যবহার করে তৈরি করা হয়েছে। এই ফর্ম্যাট আপনাকে প্যাটার্নের সাথে রেগুলার এক্সপ্রেশন বিকল্প প্রদান করতে দেয়। যেসব বিকল্প কাজ করে সেগুলি হল:

  • i: ছোট ও বড় হাতের অক্ষরের মধ্যে পার্থক্য করা হয় না।
  • m: মাল্টি-লাইন মোড (^ এবং $ লাইনের শুরু বা শেষের সাথে মেলে)।
  • s: Dotall মোড (. নতুন লাইনের সাথে মেলে)।

regexp যদি STRING হয়, তাহলে প্যাটার্নে এম্বেড করা বিকল্প ছাড়া অন্য কোনও বিকল্প প্রয়োগ করা হয় না (যেমন, (?i))।

রেগুলার এক্সপ্রেশন re2 লাইব্রেরির সিনট্যাক্স মেনে চলে।

উদাহরণ:

মান রেগুলার এক্সপ্রেশন regex_contains(value, regexp)
"Firestore" "আগুন" সত্য
"Firestore" "store$" সত্য
"Firestore" "ডেটা" মিথ্যা
"Firestore" regex("fire", "i") সত্য
"Firestore" regex("FIRE", "") মিথ্যা
Node.js
const result = await db.pipeline()
  .collection("documents")
  .select(
    field("title").regexContains("Firestore (Enterprise|Standard)")
      .as("isFirestoreRelated")
  )
  .execute();

Web

const result = await execute(db.pipeline()
  .collection("documents")
  .select(
    field("title").regexContains("Firestore (Enterprise|Standard)")
      .as("isFirestoreRelated")
  )
);
Swift
let result = try await db.pipeline()
  .collection("documents")
  .select([
    Field("title").regexContains("Firestore (Enterprise|Standard)")
      .as("isFirestoreRelated")
  ])
  .execute()

Kotlin

val result = db.pipeline()
    .collection("documents")
    .select(
        field("title").regexContains("Firestore (Enterprise|Standard)")
            .alias("isFirestoreRelated")
    )
    .execute()

Java

Task<Pipeline.Snapshot> result = db.pipeline()
    .collection("documents")
    .select(
        field("title").regexContains("Firestore (Enterprise|Standard)")
            .alias("isFirestoreRelated")
    )
    .execute();
Python
from google.cloud.firestore_v1.pipeline_expressions import Field

result = (
    client.pipeline()
    .collection("documents")
    .select(
        Field.of("title")
        .regex_contains("Firestore (Enterprise|Standard)")
        .as_("isFirestoreRelated")
    )
    .execute()
)
জাভা
Pipeline.Snapshot result =
    firestore
        .pipeline()
        .collection("documents")
        .select(
            regexContains(field("title"), "Firestore (Enterprise|Standard)")
                .as("isFirestoreRelated"))
        .execute()
        .get();
Go
snapshot := client.Pipeline().
	Collection("documents").
	Select(firestore.Fields(
		firestore.RegexContains(firestore.FieldOf("title"), "Firestore (Enterprise|Standard)").As("isFirestoreRelated"),
	)).
	Execute(ctx)

REGEX_FIND

সিনট্যাক্স:

regex_find(value: STRING, regexp: STRING | REGEX) -> STRING

বিবরণ:

value-এ প্রথম সাবস্ট্রিং রিটার্ন করে যা regexp-এর সাথে মেলে, অথবা কোনও মিল না থাকলে NULL রিটার্ন করে। regexp সঠিক রেগুলার এক্সপ্রেশন না হলে, এই ফাংশন error রিটার্ন করে।

regexp আর্গুমেন্টটি REGEX ভ্যালুও হতে পারে যা regex("pattern", "options") ব্যবহার করে তৈরি করা হয়েছে। এই ফর্ম্যাট আপনাকে প্যাটার্নের সাথে রেগুলার এক্সপ্রেশন বিকল্প প্রদান করতে দেয়। যেসব বিকল্প কাজ করে সেগুলি হল:

  • i: ছোট ও বড় হাতের অক্ষরের মধ্যে পার্থক্য করা হয় না।
  • m: মাল্টি-লাইন মোড (^ এবং $ লাইনের শুরু বা শেষের সাথে মেলে)।
  • s: Dotall মোড (. নতুন লাইনের সাথে মেলে)।

regexp যদি STRING হয়, তাহলে প্যাটার্নে এম্বেড করা বিকল্প (যেমন, (?i)) ছাড়া অন্য কোনও বিকল্প প্রযোজ্য হয় না।

রেগুলার এক্সপ্রেশন re2 লাইব্রেরির সিনট্যাক্স মেনে চলে।

উদাহরণ:

মান রেগুলার এক্সপ্রেশন regex_find(value, regexp)
"Sometext MATCH" "SomeText" "Sometext"
"Sometext MATCH" regex("match", "i") "ম্যাচ"
"Sometext MATCH" regex("(match)", "i") "ম্যাচ"
"Sometext match" regex("MATCH", "") ফাঁকা

REGEX_FIND_ALL

সিনট্যাক্স:

regex_find_all(value: STRING, regexp: STRING | REGEX) -> ARRAY<STRING>

বিবরণ:

value-এ থাকা সব সাবস্ট্রিংয়ের একটি অ্যারে দেখায় যা regexp-এর সাথে মেলে অথবা কোনও মিল না থাকলে একটি খালি অ্যারে দেখায়। regexp সঠিক রেগুলার এক্সপ্রেশন না হলে, এই ফাংশন error রিটার্ন করে।

regexp আর্গুমেন্টটি REGEX ভ্যালুও হতে পারে যা regex("pattern", "options") ব্যবহার করে তৈরি করা হয়েছে। এই ফর্ম্যাট আপনাকে প্যাটার্নের সাথে রেগুলার এক্সপ্রেশন বিকল্প প্রদান করতে দেয়। যেসব বিকল্প কাজ করে সেগুলি হল:

  • i: ছোট ও বড় হাতের অক্ষরের মধ্যে পার্থক্য করা হয় না।
  • m: মাল্টি-লাইন মোড (^ এবং $ লাইনের শুরু বা শেষের সাথে মেলে)।
  • s: Dotall মোড (. নতুন লাইনের সাথে মেলে)।

regexp যদি STRING হয়, তাহলে প্যাটার্নে এম্বেড করা বিকল্প ছাড়া অন্য কোনও বিকল্প প্রয়োগ করা হয় না (যেমন, (?i))।

রেগুলার এক্সপ্রেশন re2 লাইব্রেরির সিনট্যাক্স মেনে চলে।

উদাহরণ:

মান রেগুলার এক্সপ্রেশন regex_find_all(value, regexp)
"এক দুই তিন দুই" "এক" ["one"]
"এক দুই তিন দুই" regex("two", "i") ["TWO", "Two"]
"এক দুই তিন দুই" regex("TWO", "") [কোথায় ছিলেন?][তারপর, কোথায় ছিলেন?][এতদিন কোথায় ছিলেন?][কোথায় ছিলেন বলুন তো?][কোথায় ছিলে][কোথায় ছিলি][কোথায় ছিলি এতদিন][কোথায় ছিলে এতদিন]

REGEX_MATCH

সিনট্যাক্স:

regex_match(value: STRING, regexp: STRING | REGEX) -> BOOLEAN

বিবরণ:

value-এর সাথে regexp সম্পূর্ণভাবে মিলে গেলে TRUE রিটার্ন করে। regexp সঠিক রেগুলার এক্সপ্রেশন না হলে, এই ফাংশন error রিটার্ন করে।

regexp আর্গুমেন্টটি REGEX ভ্যালুও হতে পারে যা regex("pattern", "options") ব্যবহার করে তৈরি করা হয়েছে। এই ফর্ম্যাট আপনাকে প্যাটার্নের সাথে রেগুলার এক্সপ্রেশন বিকল্প প্রদান করতে দেয়। যেসব বিকল্প কাজ করে সেগুলি হল:

  • i: ছোট ও বড় হাতের অক্ষরের মধ্যে পার্থক্য করা হয় না।
  • m: মাল্টি-লাইন মোড (^ এবং $ লাইনের শুরু বা শেষের সাথে মেলে)।
  • s: Dotall মোড (. নতুন লাইনের সাথে মেলে)।

regexp যদি STRING হয়, তাহলে প্যাটার্নে এম্বেড করা বিকল্প ছাড়া অন্য কোনও বিকল্প প্রয়োগ করা হয় না (যেমন, (?i))।

রেগুলার এক্সপ্রেশন re2 লাইব্রেরির সিনট্যাক্স মেনে চলে।

উদাহরণ:

মান রেগুলার এক্সপ্রেশন regex_match(value, regexp)
"Firestore" "F.*store" সত্য
"Firestore" "আগুন" মিথ্যা
"Firestore" "^F.*e$" সত্য
"FiReStOrE" regex("firestore", "i") সত্য
"Firestore" regex("firestore", "") মিথ্যা
Node.js
const result = await db.pipeline()
  .collection("documents")
  .select(
    field("title").regexMatch("Firestore (Enterprise|Standard)")
      .as("isFirestoreExactly")
  )
  .execute();

Web

const result = await execute(db.pipeline()
  .collection("documents")
  .select(
    field("title").regexMatch("Firestore (Enterprise|Standard)")
      .as("isFirestoreExactly")
  )
);
Swift
let result = try await db.pipeline()
  .collection("documents")
  .select([
    Field("title").regexMatch("Firestore (Enterprise|Standard)")
      .as("isFirestoreExactly")
  ])
  .execute()

Kotlin

val result = db.pipeline()
    .collection("documents")
    .select(
        field("title").regexMatch("Firestore (Enterprise|Standard)")
            .alias("isFirestoreExactly")
    )
    .execute()

Java

Task<Pipeline.Snapshot> result = db.pipeline()
    .collection("documents")
    .select(
        field("title").regexMatch("Firestore (Enterprise|Standard)")
            .alias("isFirestoreExactly")
    )
    .execute();
Python
from google.cloud.firestore_v1.pipeline_expressions import Field

result = (
    client.pipeline()
    .collection("documents")
    .select(
        Field.of("title")
        .regex_match("Firestore (Enterprise|Standard)")
        .as_("isFirestoreExactly")
    )
    .execute()
)
জাভা
Pipeline.Snapshot result =
    firestore
        .pipeline()
        .collection("documents")
        .select(
            regexMatch(field("title"), "Firestore (Enterprise|Standard)")
                .as("isFirestoreExactly"))
        .execute()
        .get();
Go
snapshot := client.Pipeline().
	Collection("documents").
	Select(firestore.Fields(
		firestore.RegexMatch(firestore.FieldOf("title"), "Firestore (Enterprise|Standard)").As("isFirestoreExactly"),
	)).
	Execute(ctx)

STRING_CONCAT

সিনট্যাক্স:

string_concat(values: STRING...) -> STRING

বিবরণ:

দুই বা তার বেশি STRING ভ্যালু কনক্যাটিনেট করে একটি ফলাফল দেখায়।

উদাহরণ:

আর্গুমেন্ট string_concat(values...)
() ত্রুটি
("a") "a"
("abc", "def") "abcdef"
("a", "", "c") "এসি"
Node.js
const result = await db.pipeline()
  .collection("books")
  .select(
    field("title").stringConcat(" by ", field("author"))
      .as("fullyQualifiedTitle")
  )
  .execute();

Web

const result = await execute(db.pipeline()
  .collection("books")
  .select(
    field("title").stringConcat(" by ", field("author"))
      .as("fullyQualifiedTitle")
  )
);
Swift
let result = try await db.pipeline()
  .collection("books")
  .select([
    Field("title").concat([" by ", Field("author")])
      .as("fullyQualifiedTitle")
  ])
  .execute()

Kotlin

val result = db.pipeline()
    .collection("books")
    .select(
        field("title").concat(" by ", field("author"))
            .alias("fullyQualifiedTitle")
    )
    .execute()

Java

Task<Pipeline.Snapshot> result = db.pipeline()
    .collection("books")
    .select(
        field("title").concat(" by ", field("author"))
            .alias("fullyQualifiedTitle")
    )
    .execute();
Python
from google.cloud.firestore_v1.pipeline_expressions import Field

result = (
    client.pipeline()
    .collection("books")
    .select(
        Field.of("title")
        .concat(" by ", Field.of("author"))
        .as_("fullyQualifiedTitle")
    )
    .execute()
)
জাভা
Pipeline.Snapshot result =
    firestore
        .pipeline()
        .collection("books")
        .select(stringConcat(field("title"), " by ", field("author")).as("fullyQualifiedTitle"))
        .execute()
        .get();
Go
snapshot := client.Pipeline().
	Collection("books").
	Select(firestore.Fields(
		firestore.StringConcat(firestore.FieldOf("title"), " by ", firestore.FieldOf("author")).As("fullyQualifiedTitle"),
	)).
	Execute(ctx)

STRING_CONTAINS

সিনট্যাক্স:

string_contains(value: STRING, substring: STRING) -> BOOLEAN

বিবরণ:

value-এ লিটারেল স্ট্রিং substring আছে কিনা তা চেক করে।

উদাহরণ:

মান সাবস্ট্রিং string_contains(value, substring)
"abc" "b" সত্য
"abc" "d" মিথ্যা
"abc" "" সত্য
"এ.সি" "." সত্য
"☃☃☃" "☃" সত্য
Node.js
const result = await db.pipeline()
  .collection("articles")
  .select(
    field("body").stringContains("Firestore")
      .as("isFirestoreRelated")
  )
  .execute();

Web

const result = await execute(db.pipeline()
  .collection("articles")
  .select(
    field("body").stringContains("Firestore")
      .as("isFirestoreRelated")
  )
);
Swift
let result = try await db.pipeline()
  .collection("articles")
  .select([
    Field("body").stringContains("Firestore")
      .as("isFirestoreRelated")
  ])
  .execute()

Kotlin

val result = db.pipeline()
    .collection("articles")
    .select(
        field("body").stringContains("Firestore")
            .alias("isFirestoreRelated")
    )
    .execute()

Java

Task<Pipeline.Snapshot> result = db.pipeline()
    .collection("articles")
    .select(
        field("body").stringContains("Firestore")
            .alias("isFirestoreRelated")
    )
    .execute();
Python
from google.cloud.firestore_v1.pipeline_expressions import Field

result = (
    client.pipeline()
    .collection("articles")
    .select(Field.of("body").string_contains("Firestore").as_("isFirestoreRelated"))
    .execute()
)
জাভা
Pipeline.Snapshot result =
    firestore
        .pipeline()
        .collection("articles")
        .select(stringContains(field("body"), "Firestore").as("isFirestoreRelated"))
        .execute()
        .get();
Go
snapshot := client.Pipeline().
	Collection("articles").
	Select(firestore.Fields(
		firestore.StringContains(firestore.FieldOf("body"), "Firestore").As("isFirestoreRelated"),
	)).
	Execute(ctx)

STRING_INDEX_OF

সিনট্যাক্স:

string_index_of[T <: STRING | BYTES](value: T, search: T) -> INT64

বিবরণ:

value-এ search-এর প্রথম ঘটনার ০-ভিত্তিক ইন্ডেক্স ফিরিয়ে দেয়।

  • search খুঁজে না পাওয়া গেলে -1 দেখায়।
  • value যদি STRING ভ্যালু হয়, তাহলে ফলাফল ইউনিকোড কোড পয়েন্টে পরিমাপ করা হয়। এটি BYTES ভ্যালু হলে, বাইটে পরিমাপ করা হয়।
  • search যদি খালি STRING বা BYTES ভ্যালু হয়, তাহলে ফলাফল হবে 0।

উদাহরণ:

মান সার্চ করুন string_index_of(value, search)
"হ্যালো ওয়ার্ল্ড" "o" 4
"হ্যালো ওয়ার্ল্ড" "l" 2
"হ্যালো ওয়ার্ল্ড" "z" -১
"কলা" "ana" 1
"abc" "" 0
b"abc" b"b" 1
"é" "é" 0
b"é" b"é" 0

TO_UPPER

সিনট্যাক্স:

to_upper[T <: STRING | BYTES](value: T) -> T

বিবরণ:

STRING বা BYTES ভ্যালু বড় হাতের অক্ষরে কনভার্ট করে।

কোনও বাইট বা ক্যারেক্টার UTF-8 ছোট হাতের বর্ণমালার অক্ষরের সাথে না মিললে, এটি অপরিবর্তিত অবস্থায় পাস করা হয়।

উদাহরণ:

মান to_upper(value)
"abc" "ABC"
"AbC" "ABC"
b"abc" b"ABC"
b"a1c" b"A1C"
Node.js
const result = await db.pipeline()
  .collection("authors")
  .select(
    field("name").toUpper()
      .as("uppercaseName")
  )
  .execute();

Web

const result = await execute(db.pipeline()
  .collection("authors")
  .select(
    field("name").toUpper()
      .as("uppercaseName")
  )
);
Swift
let result = try await db.pipeline()
  .collection("authors")
  .select([
    Field("name").toUpper()
      .as("uppercaseName")
  ])
  .execute()

Kotlin

val result = db.pipeline()
    .collection("authors")
    .select(
        field("name").toUpper()
            .alias("uppercaseName")
    )
    .execute()

Java

Task<Pipeline.Snapshot> result = db.pipeline()
    .collection("authors")
    .select(
        field("name").toUpper()
            .alias("uppercaseName")
    )
    .execute();
Python
from google.cloud.firestore_v1.pipeline_expressions import Field

result = (
    client.pipeline()
    .collection("authors")
    .select(Field.of("name").to_upper().as_("uppercaseName"))
    .execute()
)
জাভা
Pipeline.Snapshot result =
    firestore
        .pipeline()
        .collection("authors")
        .select(toUpper(field("name")).as("uppercaseName"))
        .execute()
        .get();
Go
snapshot := client.Pipeline().
	Collection("authors").
	Select(firestore.Fields(
		firestore.ToUpper(firestore.FieldOf("name")).As("uppercaseName"),
	)).
	Execute(ctx)

TO_LOWER

সিনট্যাক্স:

to_lower[T <: STRING | BYTES](value: T) -> T

বিবরণ:

STRING বা BYTES ভ্যালুকে ছোট হাতের অক্ষরে কনভার্ট করে।

কোনও বাইট বা অক্ষর UTF-8 বড় হাতের বর্ণমালার অক্ষরের সাথে না মিললে, এটি অপরিবর্তিত অবস্থায় পাস করা হয়।

উদাহরণ:

মান to_lower(value)
"ABC" "abc"
"AbC" "abc"
"A1C" "a1c"
b"ABC" b"abc"
Node.js
const result = await db.pipeline()
  .collection("authors")
  .select(
    field("genre").toLower().equal("fantasy")
      .as("isFantasy")
  )
  .execute();

Web

const result = await execute(db.pipeline()
  .collection("authors")
  .select(
    field("genre").toLower().equal("fantasy")
      .as("isFantasy")
  )
);
Swift
let result = try await db.pipeline()
  .collection("authors")
  .select([
    Field("genre").toLower().equal("fantasy")
      .as("isFantasy")
  ])
  .execute()

Kotlin

val result = db.pipeline()
    .collection("authors")
    .select(
        field("genre").toLower().equal("fantasy")
            .alias("isFantasy")
    )
    .execute()

Java

Task<Pipeline.Snapshot> result = db.pipeline()
    .collection("authors")
    .select(
        field("genre").toLower().equal("fantasy")
            .alias("isFantasy")
    )
    .execute();
Python
from google.cloud.firestore_v1.pipeline_expressions import Field

result = (
    client.pipeline()
    .collection("authors")
    .select(Field.of("genre").to_lower().equal("fantasy").as_("isFantasy"))
    .execute()
)
জাভা
Pipeline.Snapshot result =
    firestore
        .pipeline()
        .collection("authors")
        .select(equal(toLower(field("genre")), "fantasy").as("isFantasy"))
        .execute()
        .get();
Go
snapshot := client.Pipeline().
	Collection("authors").
	Select(firestore.Fields(
		firestore.Equal(firestore.ToLower(firestore.FieldOf("genre")), "fantasy").As("isFantasy"),
	)).
	Execute(ctx)

SUBSTRING

সিনট্যাক্স:

substring[T <: STRING | BYTES](input: T, position: INT64) -> T
substring[T <: STRING | BYTES](input: T, position: INT64, length: INT64) -> T

বিবরণ:

position (শূন্য-ভিত্তিক ইন্ডেক্স) থেকে শুরু করে এবং length পর্যন্ত এন্ট্রি সহ input-এর একটি সাবস্ট্রিং দেখায়। কোনও length প্রদান করা না হলে, position থেকে input-এর শেষ পর্যন্ত সাবস্ট্রিং ফেরত দেয়।

  • input যদি STRING ভ্যালু হয়, তাহলে position এবং length ইউনিকোড কোড পয়েন্টে পরিমাপ করা হয়। এটি BYTES ভ্যালু হলে, বাইটে পরিমাপ করা হয়।

  • position-এর মান input-এর দৈর্ঘ্যের থেকে বেশি হলে, একটি খালি সাবস্ট্রিং ফেরত দেওয়া হয়। position প্লাস length যদি input-এর দৈর্ঘ্যের চেয়ে বেশি হয়, তাহলে সাবস্ট্রিংটি input-এর শেষ পর্যন্ত ট্রাঙ্কেট করা হয়।

  • position নেগেটিভ হলে, ইনপুটের শেষ থেকে পজিশন নেওয়া হয়। নেগেটিভ position-এর মান ইনপুটের সাইজের চেয়ে বেশি হলে, পজিশন শূন্যতে সেট করা হয়। length অবশ্যই নেগেটিভ নয় এমন সংখ্যা হতে হবে।

উদাহরণ:

length উল্লেখ না করা থাকলে:

ইনপুট পজিশন substring(input, position)
"abc" 0 "abc"
"abc" 1 "bc"
"abc" 3 ""
"abc" -১ "c"
b"abc" 1 b"bc"

length প্রদান করা হলে:

ইনপুট পজিশন দৈর্ঘ্য substring(input, position, length)
"abc" 0 1 "a"
"abc" 1 2 "bc"
"abc" -১ 1 "c"
b"abc" 0 1 b"a"
Node.js
const result = await db.pipeline()
  .collection("books")
  .where(field("title").startsWith("The "))
  .select(
    field("title").substring(4)
      .as("titleWithoutLeadingThe")
  )
  .execute();

Web

const result = await execute(db.pipeline()
  .collection("books")
  .where(field("title").startsWith("The "))
  .select(
    field("title").substring(4)
      .as("titleWithoutLeadingThe")
  )
);
Swift
let result = try await db.pipeline()
  .collection("books")
  .where(Field("title").startsWith("The "))
  .select([
    Field("title").substring(position: 4)
      .as("titleWithoutLeadingThe")
  ])
  .execute()

Kotlin

val result = db.pipeline()
    .collection("books")
    .where(field("title").startsWith("The "))
    .select(
        field("title")
          .substring(constant(4),
            field("title").charLength().subtract(4))
            .alias("titleWithoutLeadingThe")
    )
    .execute()

Java

Task<Pipeline.Snapshot> result = db.pipeline()
    .collection("books")
    .where(field("title").startsWith("The "))
    .select(
        field("title").substring(
          constant(4),
            field("title").charLength().subtract(4))
            .alias("titleWithoutLeadingThe")
    )
    .execute();
Python
from google.cloud.firestore_v1.pipeline_expressions import Field

result = (
    client.pipeline()
    .collection("books")
    .where(Field.of("title").starts_with("The "))
    .select(Field.of("title").substring(4).as_("titleWithoutLeadingThe"))
    .execute()
)
জাভা
Pipeline.Snapshot result =
    firestore
        .pipeline()
        .collection("books")
        .where(startsWith(field("title"), "The "))
        .select(
            substring(field("title"), constant(4), field("title").charLength())
                .as("titleWithoutLeadingThe"))
        .execute()
        .get();
Go
snapshot := client.Pipeline().
	Collection("books").
	Where(firestore.StartsWith(firestore.FieldOf("title"), "The ")).
	Select(firestore.Fields(
		firestore.Substring(firestore.FieldOf("title"), firestore.ConstantOf(4), firestore.FieldOf("title").CharLength()).As("titleWithoutLeadingThe"),
	)).
	Execute(ctx)

STRING_REVERSE

সিনট্যাক্স:

string_reverse[T <: STRING | BYTES](input: T) -> T

বিবরণ:

প্রদান করা ইনপুট বিপরীত ক্রমে দেখায়।

ইনপুট STRING হলে ইউনিকোড কোড পয়েন্টের মাধ্যমে অক্ষরগুলি চিহ্নিত করা হয়, এবং ইনপুট BYTES ভ্যালু হলে বাইটের মাধ্যমে চিহ্নিত করা হয়।

উদাহরণ:

ইনপুট string_reverse(input)
"abc" "cba"
"a🌹b" "b🌹a"
"হ্যালো" "olleh"
b"abc" b"cba"
Node.js
const result = await db.pipeline()
  .collection("books")
  .select(
    field("name").reverse().as("reversedName")
  )
  .execute();

Web

const result = await execute(db.pipeline()
  .collection("books")
  .select(
    field("name").reverse().as("reversedName")
  )
);
Swift
let result = try await db.pipeline()
  .collection("books")
  .select([
    Field("name").reverse().as("reversedName")
  ])
  .execute()

Kotlin

val result = db.pipeline()
    .collection("books")
    .select(
        field("name").reverse().alias("reversedName")
    )
    .execute()

Java

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

result = (
    client.pipeline()
    .collection("books")
    .select(Field.of("name").string_reverse().as_("reversedName"))
    .execute()
)
জাভা
Pipeline.Snapshot result =
    firestore
        .pipeline()
        .collection("books")
        .select(reverse(field("name")).as("reversedName"))
        .execute()
        .get();
Go
snapshot := client.Pipeline().
	Collection("books").
	Select(firestore.Fields(
		firestore.Reverse(firestore.FieldOf("name")).As("reversedName"),
	)).
	Execute(ctx)

STRING_REPEAT

সিনট্যাক্স:

string_repeat[T <: STRING | BYTES](input: T, repetitions: INT64) -> T

বিবরণ:

input-কে repetitions বার রিপিট করে দেখায়।

  • repetitions অবশ্যই নেগেটিভ নয় এমন পূর্ণসংখ্যা হতে হবে।
  • repetitions যদি 0 হয়, তাহলে input-এর মতো একই ধরনের খালি ভ্যালু দেখায়।
  • ফলাফল অনুমোদিত সর্বাধিক সাইজ (১ এমবি) পেরিয়ে গেলে, একটি সমস্যা দেখানো হয়।

উদাহরণ:

ইনপুট বার string_repeat(input, repetitions)
"foo" 3 "foofoofoo"
"foo" 0 ""
"একটি " 3 "a a a "
b"ab" 2 b"abab"
"é🦆" 2 "é🦆é🦆"

STRING_REPLACE_ALL

সিনট্যাক্স:

string_replace_all[T <: STRING | BYTES](input: T, find: T, replacement: T) -> T

বিবরণ:

input-এ find-এর সব নন-ওভারল্যাপিং ঘটনা replacement দিয়ে পরিবর্তন করে।

  • ম্যাচ করার সময় ছোট ও বড় হাতের অক্ষরের মধ্যে পার্থক্য করা হয়।
  • find ফাঁকা থাকলে, কোনও কিছু পরিবর্তন করা হয় না।

উদাহরণ:

ইনপুট খুঁজুন পরিবর্তে string_replace_all(input, find, replacement)
"foobarfoo" "foo" "baz" "bazbarbaz"
"ababab" "aba" "c" "cbab"
"foobar" "o" "" "fbar"
"é🦆🌎🦆" "🦆" "a" "éa🌎a"
b"abc" b"b" b"d" b"adc"

STRING_REPLACE_ONE

সিনট্যাক্স:

string_replace_one[T <: STRING | BYTES](input: T, find: T, replacement: T) -> T

বিবরণ:

input-এ find-এর প্রথম ঘটনাকে replacement দিয়ে প্রতিস্থাপন করে।

  • ম্যাচ করার সময় ছোট ও বড় হাতের অক্ষরের মধ্যে পার্থক্য করা হয়।
  • find ফাঁকা থাকলে, কোনও কিছু পরিবর্তন করা হয় না।

উদাহরণ:

ইনপুট খুঁজুন পরিবর্তে string_replace_one(input, find, replacement)
"foobarfoo" "foo" "baz" "bazbarfoo"
"é" "é" "a" "a"
b"foobar" b"o" b"z" b"fzoobar"

ট্রিম করুন

সিনট্যাক্স:

trim[T <: STRING | BYTES](input: T, values_to_trim: T) -> T
trim[T <: STRING | BYTES](input: T) -> T

বিবরণ:

প্রদান করা input-এর শুরু ও শেষ থেকে BYTES বা CHARS-এর নির্দিষ্ট সেট ট্রিম করে।

  • কোনও values_to_trim প্রদান করা না হলে, হোয়াইটস্পেস অক্ষর ট্রিম করে।

উদাহরণ:

values_to_trim উল্লেখ না করা থাকলে:

ইনপুট trim(input)
" foo " "foo"
b" foo " b"foo"
"foo" "foo"
"" ""
" " ""
"\t foo \n" "foo"
b"\t foo \n" b"foo"
"\r\f\v foo \r\f\v" "foo"
b"\r\f\v foo \r\f\v" b"foo"

values_to_trim প্রদান করা হলে:

ইনপুট values_to_trim trim(input, values_to_trim)
"abcbfooaacb" "abc" "foo"
"abcdaabadbac" "abc" "দাবাদ"
b"C1C2C3" b"C1" b"C2C3"
b"C1C2" "foo" ত্রুটি
"foo" b"C1" ত্রুটি

Web

const result = await execute(db.pipeline()
  .collection("books")
  .select(
    field("name").trim().as("whitespaceTrimmedName")
  )
);
Swift
let result = try await db.pipeline()
  .collection("books")
  .select([
    Field("name").trim(" \n\t").as("whitespaceTrimmedName")
  ])
  .execute()

Kotlin

val result = db.pipeline()
    .collection("books")
    .select(
        field("name").trim().alias("whitespaceTrimmedName")
    )
    .execute()

Java

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

result = (
    client.pipeline()
    .collection("books")
    .select(Field.of("name").trim().as_("whitespaceTrimmedName"))
    .execute()
)
জাভা
Pipeline.Snapshot result =
    firestore
        .pipeline()
        .collection("books")
        .select(trim(field("name")).as("whitespaceTrimmedName"))
        .execute()
        .get();
Go
snapshot := client.Pipeline().
	Collection("books").
	Select(firestore.Fields(
		firestore.Trim(firestore.FieldOf("name")).As("whitespaceTrimmedName"),
	)).
	Execute(ctx)

LTRIM

সিনট্যাক্স:

ltrim[T <: STRING | BYTES](value: T, to_trim: T) -> T
ltrim[T <: STRING | BYTES](value: T) -> T

বিবরণ:

প্রদত্ত value-এর শুরু থেকে BYTES বা CHARS-এর নির্দিষ্ট সেট ট্রিম করে।

  • to_trim প্রদান করা না হলে, প্রথমের হোয়াইটস্পেস অক্ষর ট্রিম করে।

উদাহরণ:

to_trim উল্লেখ না করা থাকলে:

মান ltrim(value)
" foo " "foo "
"foo" "foo"

to_trim প্রদান করা হলে:

মান to_trim ltrim(value, to_trim)
"aaabc" "a" "bc"
"abacaba" "ba" "caba"
"é" "é" ""

RTRIM

সিনট্যাক্স:

rtrim[T <: STRING | BYTES](value: T, to_trim: T) -> T
rtrim[T <: STRING | BYTES](value: T) -> T

বিবরণ:

প্রদান করা value-এর শেষ থেকে BYTES বা CHARS-এর নির্দিষ্ট সেট ট্রিম করে।

  • to_trim প্রদান করা না হলে, ট্রেলিং হোয়াইটস্পেস অক্ষর ট্রিম করে।

উদাহরণ:

to_trim উল্লেখ না করা থাকলে:

মান rtrim(value)
" foo " " foo"
"foo" "foo"

to_trim প্রদান করা হলে:

মান to_trim rtrim(value, to_trim)
"abccc" "c" "ab"
"abacaba" "ba" "abac"
"é" "é" ""

স্প্লিট

সিনট্যাক্স:

split(input: STRING) -> ARRAY<STRING>
split[T <: STRING | BYTES](input: T, delimiter: T) -> ARRAY<T>

বিবরণ:

ডিলিমিটার ব্যবহার করে STRING বা BYTES ভ্যালু স্প্লিট করে।

  • STRING-এর জন্য ডিফল্ট ডিলিমিটার হল কমা ,। ডিলিমিটারকে একটি একক স্ট্রিং হিসেবে বিবেচনা করা হয়।

  • BYTES-এর জন্য, আপনাকে অবশ্যই একটি ডিলিমিটার উল্লেখ করতে হবে।

  • খালি ডিলিমিটারে স্প্লিট করলে STRING ভ্যালুর জন্য ইউনিকোড কোডপয়েন্টের অ্যারে এবং BYTES ভ্যালুর জন্য BYTES-এর অ্যারে তৈরি হয়।

  • খালি STRING স্প্লিট করলে একটি খালি STRING সহ ARRAY পাওয়া যায়।

উদাহরণ:

delimiter উল্লেখ না করা থাকলে:

ইনপুট split(input)
"foo,bar,foo" ["foo", "bar", "foo"]
"foo" ["foo"]
",foo," ["", "foo", ""]
"" [""]
b"C120C2C4" ত্রুটি

delimiter প্রদান করা হলে:

ইনপুট ডিলিমিটার split(input, delimiter)
"foo bar foo" " " ["foo", "bar", "foo"]
"foo bar foo" "z" ["foo bar foo"]
"abc" "" ["a", "b", "c"]
b"C1,C2,C4" b"," [b"C1", b"C2", b"C4"]
b"ABC" b"" [b"A", b"B", b"C"]
"foo" b"C1" ত্রুটি