Cheeel666

Untitled

May 17th, 2022
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. function isEmpty(val){
  2. return (val === undefined || val == null || val.length <= 0) ? true : false;
  3. }
  4.  
  5. let empids = new Array();
  6. db.questionaries.find().forEach(function(u) {
  7. db.employees.find({"userid":u.userid}).forEach(e => {
  8. if(isEmpty(e.inn) && !isEmpty(u.inn)) {
  9. empids.push(e.employeeid);
  10. db.employees.updateOne({"userid":u.userid}, {$set:{"inn":u.inn}});
  11. };
  12. });
  13. });
Advertisement
Add Comment
Please, Sign In to add comment