Updating Multiple Records with Typesense

TLDR Shabber wanted to update multiple records based on ids. Kishore Nallan suggested using the import endpoint with 'update' action mode and provided examples.

Photo of Shabber
Shabber
Fri, 09 Jun 2023 12:28:18 UTC

curl -X DELETE \ -H "X-TYPESENSE-API-KEY: oKsdsdsd7D2SXjtd6MjXxWjjlkkhjc5mQeGpcU2OdfvdsfdsOXl7zZmuWfqaWsdsdc9rG6Ohw" \ for delete this works, but need to update individual records based on id

Photo of Kishore Nallan
Kishore Nallan
Fri, 09 Jun 2023 13:44:19 UTC

Use import with `update` action mode:

Photo of Shabber
Shabber
Mon, 12 Jun 2023 04:36:02 UTC

Thank You

Photo of Shabber
Shabber
Mon, 12 Jun 2023 04:59:55 UTC

One last question, similar way ```curl "" -X POST \ -H "Content-Type: application/json" \ -H "X-TYPESENSE-API-KEY: ${TYPESENSE_API_KEY}" \ -d '{ "id": "124", "company_name": "Stark Industries", "num_employees": 5215, "country": "USA" }'```

Photo of Shabber
Shabber
Mon, 12 Jun 2023 05:00:09 UTC

cant i update multiple records at once ?

Photo of Kishore Nallan
Kishore Nallan
Mon, 12 Jun 2023 05:14:14 UTC

The import endpoint supports sending documents 1 per line

Photo of Kishore Nallan
Kishore Nallan
Mon, 12 Jun 2023 05:14:36 UTC

The documentation page above has examples

Photo of Shabber
Shabber
Mon, 12 Jun 2023 05:15:50 UTC

Thank you will check on it