Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function isEmpty(val){
- return (val === undefined || val == null || val.length <= 0) ? true : false;
- }
- db.quest_inn.find({"contracttypeid":5}).forEach(function(u) {
- db.emp_inn.find({"userid":u.userid}).forEach(e => {
- if(isEmpty(e.inn) && !isEmpty(u.inn)) {
- db.emp_inn.updateOne({"userid":u.userid}, {$set:{"inn":u.inn}});
- };
- });
- });
- db.quest_inn.find()
Advertisement
Add Comment
Please, Sign In to add comment