I'm doing tutorial from here: node-mongodb-native
And I don't know why sth like this works:
collection.insert(doc, {w:1}, function(err, result) {});
collection.update({mykey:1}, {$set:{fieldtoupdate:2}}, {w:1}, function(err, result) {});
And this doesn't:
collection.insert(doc, {w:1}, function(err, result) {
collection.update({mykey:1}, {$set:{fieldtoupdate:2}}, {w:1}, function(err, result) {});
});
Any ideas?