Is there any way to load the data from single json file to multiple collections…? Example: based on a name like FORM, data belonging to FORM1 shld be loaded into FORM1 collection and FORM2 data should be loaded into FORM2 collection.
I mean using the utilities like mongodump or mongoimport or mongorestore… or … do we need to write any script programmatically?
Hi, unfortunately there’s currently no way of doing this with mongoimport or mongorestore.
There is an open feature request to add a --filter option to mongorestore which would allow you to do this (TOOLS-2148). But for now you would have to write your own script.