Cloud Firestore Enterprise edition in Native mode is now available!
Learn more.
ฟังก์ชันทั่วไป
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ฟังก์ชันทั่วไป
| ชื่อ
|
คำอธิบาย
|
CONCAT
|
เชื่อมต่อค่า 2 ค่าขึ้นไปที่มีประเภทเดียวกัน
|
LENGTH
|
คำนวณความยาวของ String, Bytes, Array, Vector หรือ Map
|
REVERSE
|
ย้อนกลับ String, Bytes หรือ Array
|
ตัวอย่างไคลเอ็นต์
Node.js
concat(constant("Author ID: "), field("authorId"));
Web
concat(constant("Author ID: "), field("authorId"));
Swift
let displayString = Constant("Author ID: ").concat([Field("authorId")])
Kotlin
val displayString = constant("Author ID: ").concat(field("authorId"))
Java
Expression displayString = constant("Author ID: ").concat(field("authorId"));
Python
Constant.of("Author ID: ").concat(Field.of("authorId"))
CONCAT
ไวยากรณ์:
concat[T <: STRING | BYTES | ARRAY](values:T ...) -> T
คำอธิบาย:
เชื่อมต่อค่า 2 ค่าขึ้นไปที่มีประเภทเดียวกัน
ตัวอย่าง
| values |
concat(values) |
| "abc", "def" |
"abcdef" |
| [1, 2], [3, 4] |
[1, 2, 3, 4] |
| b"abc", b"def" |
b"abcdef" |
| "abc", [1,2,3], "ghi" |
ข้อผิดพลาด |
| [1,2,3] |
ข้อผิดพลาด |
| "abc", null |
Null |
ความยาว
ไวยากรณ์:
length[T <: STRING | BYTES | ARRAY | VECTOR | MAP](value: T) -> INT64
คำอธิบาย:
คำนวณความยาวของค่า String, Bytes, Array, Vector หรือ Map
ตัวอย่าง
| value |
length(value) |
| "สวัสดี" |
5 |
| [1, 2, 3, 4] |
4 |
| b"abcde" |
5 |
| Null |
Null |
| 1 |
ข้อผิดพลาด |
ย้อนกลับ
ไวยากรณ์:
reverse[T <: STRING | BYTES | ARRAY](value: T) -> T
คำอธิบาย:
แสดงค่า String, Bytes หรือ Array แบบกลับกัน
ตัวอย่าง
| value |
reverse(value) |
| "สวัสดี" |
"olleh" |
| [1, 2, 3] |
[3, 2, 1] |
| b"abc" |
b"cba" |
| 23 |
ข้อผิดพลาด |
| Null |
Null |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2026-02-06 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2026-02-06 UTC"],[],[]]