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;
- }
- let empids = new Array();
- db.questionaries.find().forEach(function(u) {
- db.employees.find({"userid":u.userid}).forEach(e => {
- if(isEmpty(e.inn) && !isEmpty(u.inn)) {
- empids.push(e.employeeid);
- db.employees.updateOne({"userid":u.userid}, {$set:{"inn":u.inn}});
- };
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment