“Array Pembaruan Firestore” Kode Jawaban

Array Pembaruan Firestore

let washingtonRef = db.collection('cities').doc('DC');

// Atomically add a new region to the "regions" array field.
let arrUnion = washingtonRef.update({
  regions: admin.firestore.FieldValue.arrayUnion('greater_virginia')
});
// Atomically remove a region from the "regions" array field.
let arrRm = washingtonRef.update({
  regions: admin.firestore.FieldValue.arrayRemove('east_coast')
});
Egg Salad

Document.set () FirebaseFirestore Java

var washingtonRef = db.collection("cities").doc("DC");
// Atomically add a new region to the "regions" array field.
washingtonRef.update({
    regions: firebase.firestore.FieldValue.arrayUnion("greater_virginia")
});
// Atomically remove a region from the "regions" array field.
washingtonRef.update({
    regions: firebase.firestore.FieldValue.arrayRemove("east_coast")
});
Open Oyster

Jawaban yang mirip dengan “Array Pembaruan Firestore”

Pertanyaan yang mirip dengan “Array Pembaruan Firestore”

Lebih banyak jawaban terkait untuk “Array Pembaruan Firestore” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya