Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added importStream support for documents #215

Merged
merged 3 commits into from
Jul 23, 2024

Conversation

kopertop
Copy link
Contributor

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

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.
@jasonbosco
Copy link
Member

Could you add a test for this?

@kopertop
Copy link
Contributor Author

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

@jasonbosco jasonbosco merged commit 2d42360 into typesense:master Jul 23, 2024
1 check passed
@jasonbosco
Copy link
Member

That works, thank you!

Published this in v2.0.0-0

@kopertop kopertop deleted the feature/import-stream branch August 7, 2024 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants