JSON files - data loading

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?

Best Regards

1 Like

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.


This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.