node.js - Mongodb collection intersection -




i'm new mongodb , need faster way write following script:

db.lth1.find().foreach(      function(mydoc) {          db.corpus.find({             'p': mydoc._id.p,             's': mydoc._id.s,             'o': mydoc._id.o         }).foreach(function(newdoc){             db.newdb1.insertone(newdoc, function(err, res) {                 if (err) throw err;                 console.log("1 document inserted");          }) } ); } ) 





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -