This message was deleted.
# community-help
s
This message was deleted.
e
this has nothing to do with typesense. you have to do this with your api. are you using firestore?
k
Yes, there is a way to do an update based on a condition. Example:
Copy code
export FILTER_CLAUSE="id:foo && timestamp:>1700824268"
curl "http://localhost:8108/collections/docs/documents?filter_by=$FILTER_CLAUSE" -X PATCH \
        -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" -d '{"title": "New title"}'
Relevant page in documentation (Update by Query): https://typesense.org/docs/0.25.1/api/documents.html#update-by-query
i
Would this also upsert if the document does not exist yet?
k
No, this would only be an update. Please create a feature request issue on Github for implementing something similar for upsert. Maybe the document insert API that uses
POST
can support a filter by clause as well.
👍 1
e
looks like misunderstood your question. my bad @Imtiaz Mangerah 😅
😅 1