in how many ways can i inject a collection in a ty...
# community-help
s
in how many ways can i inject a collection in a typesense sever ?
j
When you say inject a collection, do you mean add documents to a collection?
s
yes sir
j
s
thank you, can suggest what would be the easiest way to maintain updating those objects
j
That would depend on the architecture of the rest of your stack. For example if you had a small relational database, you could simply poll for changes and update the documents in Typesense using the update endpoint: https://typesense.org/docs/0.20.0/api/documents.html#update-a-document or
update
action mode in the import endpoint.
If you had an event-based system with a queue for example, you can send changes to Typesense as these events occur
s
its a small react app with mysql db... i was thinking more like how do i send multiple updates at ones, like a batch
j
The documents/import endpoint has an update action mode using which you update a batch of records: https://typesense.org/docs/0.20.0/api/documents.html#action-modes
s
just the id need to match and it will rewrite/update it...right!
j
Yup
s
will the entire thing fail if like one of the id's don't match
or an extra field is added out of schema
j
No, you'll get an error response for just that record, and the others will succeed
s
wow that's great, thank you so much...and great work making this awesome thing, i'll try to contribute to the typesense community in future in any way i can, it's really great. 😄
🙏 1
j
Thank you :D
🙏 1