MongoDB ETL nested document read and write

92 Views Asked by At

What is the best ETL tool which can help read and write nested documents in MongoDB?

1

There are 1 best solutions below

0
Sohan.Choudhury On

You can use Javascript for this. Sample Code for reading:

db.setSlaveOk();
fields = ['curForm'];
db.BPRAForm.find({formType:'BPNSoCForm',status:2}).forEach(
      function(curForm){
           print(fieldArray.join(','))
  });

How to run it :

mongo --username <username> --password <password> --host <hostname> <Database_name> <Script_name> > <Out_putfile>

You can use Pentaho Data Integration tool (a.k.a. Kettle) for this, But it is slow for large set of data.