Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions firestore/HOOKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Hooks allow you to customize the process of exporting a collection of Firestore
## Writing a hook

#### Create a .js file for your collection
If your Firestore collection is called `users` then create a file called `users.js` in the current folder.
If your Firestore collection is called `users` then create a file called `users_processDocument.js` in the same directory as the `firestore2json.js` script.

#### Constructing your .js file
The basic format of a hook file looks like this:
Expand Down Expand Up @@ -37,7 +37,7 @@ The parameters passed to your hook are:
##### Add a new (unique) numeric key to a collection
```js
module.exports = (collectionName, doc, recordCounters, writeRecord) => {
doc.unique_key = (recordCounter[collectionName] + 1);
doc.unique_key = (recordCounters[collectionName] + 1);
return doc;
}
```
Expand Down