Skip to content
This repository has been archived by the owner on Feb 10, 2022. It is now read-only.

Bulk insert #194

Open
vinaybedre opened this issue Sep 17, 2017 · 3 comments
Open

Bulk insert #194

vinaybedre opened this issue Sep 17, 2017 · 3 comments

Comments

@vinaybedre
Copy link

Hi,

Using mongorito, is it possible to save multiple instances of an object to MongoDB?

@DavidBernal
Copy link

Quick and dirty:

import User from 'User';

var a = new User();
var b = new User();
var c = [a, b];

c.forEach(u => u.save())

Is it good for you?

@vinaybedre
Copy link
Author

hi @DavidBernal
Thanks for the hint, but this is very obvious and expected :-)

What if I have thousands of documents to be inserted? Kind of bulk data insert. (at least 1000+ documents to be inserted at a time).
Is there a way?

@vadimdemedes
Copy link
Owner

Currently, there's no API to bulk insert. I'll keep that as a feature request, thanks!

@vadimdemedes vadimdemedes changed the title How to save multiple objects in single call? Bulk insert Sep 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants