Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Product.update({
- _id:{$in:connected},
- connectedFarms:{$not:{$elemMatch:{_id:farm._id}}}
- },{
- $push:{connectedFarms:{_id:farm._id}}
- },{
- multi:true
- })
- Product.find({
- _id:{$in:connected},
- connectedFarms:{$not:{$elemMatch:{_id:farm._id}}}
- })
Add Comment
Please, Sign In to add comment