Add standalone document mutation functions - #10
Conversation
Add setDocument, updateDocument, and deleteDocument (plus their *SpecificDocument variants) as thin typed wrappers around the Firestore SDK write operations. This allows callers to perform mutations without fetching the document first.
There was a problem hiding this comment.
Pull request overview
Adds standalone Firestore write helpers to complement the existing hook- and fetch-based APIs, enabling typed document mutations when the caller already knows the document path.
Changes:
- Introduces standalone mutation wrappers:
setDocument,updateDocument,deleteDocument(+*SpecificDocumentvariants). - Re-exports the new write helpers from the public entrypoint.
- Documents the new write helpers in
README.mdandCLAUDE.md.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/write-document.ts | Adds standalone typed wrappers around Firestore setDoc/updateDoc/deleteDoc. |
| src/index.ts | Exposes the new write module via the package barrel export. |
| README.md | Documents the new write functions and references them from the mutations section. |
| CLAUDE.md | Updates the project API overview list to include the new write helpers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Without options, data requires all fields (WithFieldValue<T>).
With SetOptions, partial data is accepted (PartialWithFieldValue<T>).
Also removes the options ?? {} fallback.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Adds standalone typed write functions (
setDocument,updateDocument,deleteDocumentand their*SpecificDocumentvariants) as thin wrappers around the Firestore SDK. These allow performing mutations without fetching the document first, which is useful when the caller already knows the document path.The
set*functions use overloads matching Firebase's ownsetDocsignature: without options all fields are required (WithFieldValue<T>), withSetOptionspartial data is accepted (PartialWithFieldValue<T>).Also updates the README and CLAUDE.md to document the new functions.