Skip to content

Commit 61d0f5a

Browse files
committed
docs(firestore): update README.md
1 parent f933194 commit 61d0f5a

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

packages/firestore/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,36 @@ const deleteDocument = async () => {
9393
});
9494
};
9595

96+
const writeBatch = async () => {
97+
await FirebaseFirestore.writeBatch({
98+
operations: [
99+
{
100+
type: 'set',
101+
reference: 'users/Aorq09lkt1ynbR7xhTUx',
102+
data: {
103+
first: 'Alan',
104+
last: 'Turing',
105+
born: 1912
106+
},
107+
options: { merge: true },
108+
},
109+
{
110+
type: 'update',
111+
reference: 'users/Aorq09lkt1ynbR7xhTUx',
112+
data: {
113+
first: 'Alan',
114+
last: 'Turing',
115+
born: 1912
116+
},
117+
},
118+
{
119+
type: 'delete',
120+
reference: 'users/Aorq09lkt1ynbR7xhTUx',
121+
},
122+
],
123+
});
124+
};
125+
96126
const getCollection = async () => {
97127
const { snapshots } = await FirebaseFirestore.getCollection({
98128
reference: 'users',

0 commit comments

Comments
 (0)