typesense / typesense-js

JavaScript / TypeScript client for Typesense
https://typesense.org/docs/api
Apache License 2.0
393 stars 74 forks source link

Added `importStream` support for documents #215

Closed kopertop closed 4 weeks ago

kopertop commented 1 month ago

Similar to exportStream for documents, this adds a new option to IMPORT via a Node.js Stream:

const fileStream = createReadStream(fileName);
client.collections(collectionName).documents().importStream(fileStream, options);

This allows for importing larger files, which is very useful when doing a full "restore" of a collection after replacing it.

Change Summary

This adds an importStream function, similar to the exportStream function already on Collections. Very useful for importing a large file that was exported via exportStream.

PR Checklist

jasonbosco commented 1 month ago

Could you add a test for this?

kopertop commented 4 weeks ago

Sorry I missed the reply earlier, I've added some quick tests, does this work?

jasonbosco commented 4 weeks ago

That works, thank you!

Published this in v2.0.0-0