#community-help

Querying and Updating Specific Documents in Client Collections

TLDR Philipe inquired about updating documents using a query. Kishore Nallan said it's not possible yet, requested a Github issue to incorporate it into their roadmap.

Powered by Struct AI
9
21mo
Solved
Join the chat
Dec 14, 2021 (21 months ago)
Philipe
Photo of md5-c8ecfcc43b1c3d4d27560b8354025800
Philipe
12:40 PM
Hi! I am wondering, is there something like this
client.collections('companies').documents().where({fieldA: 'xyz'}).update(document)
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
01:02 PM
We don't have a way to update documents in bulk using a query.
01:02
Kishore Nallan
01:02 PM
So you to filter -> get documents -> and then do a bulk update.
Philipe
Photo of md5-c8ecfcc43b1c3d4d27560b8354025800
Philipe
01:06 PM
ah, i did not mean in bulk. i meant
.where({specificfield: 'specificIdentifier'})
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
01:07 PM
If the document can be identified by the id then: https://typesense.org/docs/0.22.1/api/documents.html#update-a-document

Don't have a way to target using a regular field.
Philipe
Photo of md5-c8ecfcc43b1c3d4d27560b8354025800
Philipe
01:09 PM
thanks. targeting using a regular field would be practical to have i think. FEATURE REQUEST
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
01:10 PM
Yes, I certainly agree. Can you please create a github issue. We will add it to our roadmap and prioritize.
Philipe
Photo of md5-c8ecfcc43b1c3d4d27560b8354025800
Philipe
01:10 PM
ok, cool, will do
01:19
Philipe
01:19 PM
done