Once in a big while, I need to save 10000 documents into a collection at once, and move that 10000 documents to another collection when the time comes. The thing is it takes 9 minutes to do so. Reasonable but it's still pretty long.
I googled a bit and found out that MongoDB can do bulk insert, but I can't find that function in Cloud Code.
Is there any better way to do bulk insert and move to another collection than save/remove them all individually?
Best Answer
C
Customer Support
said
almost 7 years ago
Hi Nipitpon,
Currently we don't expose MongoDB bulk operations to javascript. There is a method for doing this using a python script which you can read about in a forum post here. From the sounds of it you are already doing something similar ? At the moment this is the most efficient way to do it. If you have any more questions just let me know.
Thanks,
Liam
1 Comment
Customer Support
said
almost 7 years ago
Answer
Hi Nipitpon,
Currently we don't expose MongoDB bulk operations to javascript. There is a method for doing this using a python script which you can read about in a forum post here. From the sounds of it you are already doing something similar ? At the moment this is the most efficient way to do it. If you have any more questions just let me know.
Nipitpon Wongsuparatkul
Once in a big while, I need to save 10000 documents into a collection at once, and move that 10000 documents to another collection when the time comes. The thing is it takes 9 minutes to do so. Reasonable but it's still pretty long.
I googled a bit and found out that MongoDB can do bulk insert, but I can't find that function in Cloud Code.
Is there any better way to do bulk insert and move to another collection than save/remove them all individually?
Hi Nipitpon,
Currently we don't expose MongoDB bulk operations to javascript. There is a method for doing this using a python script which you can read about in a forum post here. From the sounds of it you are already doing something similar ? At the moment this is the most efficient way to do it. If you have any more questions just let me know.
Thanks,
Liam
Customer Support
Hi Nipitpon,
Currently we don't expose MongoDB bulk operations to javascript. There is a method for doing this using a python script which you can read about in a forum post here. From the sounds of it you are already doing something similar ? At the moment this is the most efficient way to do it. If you have any more questions just let me know.
Thanks,
Liam
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics