Join Slack
Powered by
Hi, is there a way to do a partial upsert of a doc...
# community-help
g
gab gab
08/30/2021, 5:44 PM
Hi, is there a way to do a partial upsert of a document? Thank you
j
Jason Bosco
08/30/2021, 5:45 PM
Partial update you mean? Because upsert by definition is the full document (if this document doesn't exist, then insert this as the full document)
g
gab gab
08/30/2021, 5:46 PM
Ah ok I see 🙂 Ok so I should either do an update or creation.
gab gab
08/30/2021, 5:46 PM
Thanks
j
Jason Bosco
08/30/2021, 5:47 PM
Yup, upserts are already supported for single docs:
https://typesense.org/docs/0.21.0/api/documents.html#upsert
and batch docs:
https://typesense.org/docs/0.21.0/api/documents.html#action-modes
(action=upsert)
Jason Bosco
08/30/2021, 5:48 PM
And if you want to do a partial (or full) update: Single:
https://typesense.org/docs/0.21.0/api/documents.html#update-a-document
: Batch:
https://typesense.org/docs/0.21.0/api/documents.html#action-modes
(action=update)
👍 1
g
gab gab
08/30/2021, 5:50 PM
I was asking this because I have an input from a hook that is a partial document with optionnaly the id of the document. So I will call either update or create.
👍 1
2
Views
Open in Slack
Previous
Next