Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for(let i=0; i<test.length; i++;){
- db.collection('Parent').find({ "Id" : test[i].Id }).toArray(function(err, result){
- if(result.length > 0){
- db.collection('anotherCollection', function(err, collection){
- collection.insert({
- field1: test[i].field1,
- field2: test[i].field2
- })
- })
- }
- })
- }
Add Comment
Please, Sign In to add comment