#random

Suggestion for Supporting Bulk Patch-Update API

TLDR Atul suggests supporting bulk patch-update API, but Jason mentions the action=emplace option which allows sending partial attributes.

Powered by Struct AI
+11
eyes1
5
5mo
Solved
Join the chat
Apr 05, 2023 (5 months ago)
Atul
Photo of md5-b28e2b6cff9ce32901c5ee87b38aecd5
Atul
10:24 AM
Hi Guys,

I think we should support bulk patch-update API.
Right now I can update an attribute of one row at a time. Using PATCH API:
PATCH ${TYPESENSE_HOST}/collections/:collection/documents/:id

And we have other option to update using
/collections/products/documents/import?action=upsert

But the problem with the 2nd option is, we need to send all the attributes. Not just changed ones.
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
10:25 AM
There’s action=emplace using which you can send partial attributes
eyes1
Atul
Photo of md5-b28e2b6cff9ce32901c5ee87b38aecd5
Atul
10:27 AM
Is this a new release/feature?
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
10:27 AM
0.24.1 is a new release as of yesterday. But emplace has been around since 0.23.1
+11