googleapis / googleapis/google-cloud-node

Multi DB Batch writes

Open
#7,449 5 comments 0 reactions 1 assignee Claimed by @cherylEnkidu View on GitHub
api: firestore library: nodejs-firestore priority: p3 type: question
Dominant language
TypeScript
Stars
3.2k
Forks
712
Avg merge
2d 3h
Merged PRs (30d)
99

Description

Hi all,

Im currently implementing regional db's in my organization and Im wondering if batchWrites will use the internal firebase ref to target the correct database or if all operations (set, update, delete, etc.) will use be written to the database the batch was created from.

e.g.
```js
...
dbp1 = admin.app('us').firestore().doc('/path/to/doc/us');
dbp2 = admin.app('ca').firestore().doc('diff/path');

const batch = admin.app('ca').firestore().batch();
batch.set(dbp1, { updatedAt: now });
batch.set(dbp2, { updatedAt: now });
batch.commit()
...
```
^^^ Will this write to both 'us' and 'ca' databases or just the 'ca' one.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.