Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 739 //Inserting object into the database
- 740 db.collection(machine + '_JobCompletion', function(err, collection) {
- 741 console.log('INSERTING TO DATABASE');
- 742 // console.log(JSON.stringify(obj));
- 743
- 744 console.log('using update DDD:');
- 745 collection.update({'objDate' : 'HELLO'}, {name : 'Cong'}, true, {safe:true});
- 746 /*
- 747 collection.find(function(err, cursor) {
- 748 console.log('inside find :D');
- 749 cursor.toArray(function(err, docs) {
- 750 console.log('inside cursor.toArray :DDDD');
- 751 docs.forEach(function(doc) {
- 752 console.log('inside collection checking >:DDDDD'); 753 console.log('doc: ' + doc);
- 754
- 755 if (doc.objDate == dateObj) {
- 756 console.log('========================================SAME ELEMENT FOUND! DATE: ' + dateOb
- j);
- 757 //delete found obj in database
- 758 }
- 759 else {
- 760 console.log('========================================NO MATCH');
- 761 }
- 762 });
- 763 });
- 764 });
- 765
- 766
- 767 console.log('about to insert obj XD');
- 768 collection.insert(obj, {safe:true}, function(err, objects) {
- 769 if (err) {console.warn(err.message);}
- 770 });
- 771 */
- 772 });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement