I'm trying to do a simple document update using Monk however the following exception gets thrown:
.../node_modules/monk/node_modules/mongoskin/node_modules/mongodb/node_modules/bson/lib/bson/objectid.js:35
throw new Error("Argument passed in must be a single String of 12 bytes or
My code is quite simple:
var db = require('monk')('localhost/app'),
raw = db.get('raw'),
stats = db.get('daily');
stats.updateById("1_20141108", {$set: { last_updated: 123 }, $inc: {"stats.facebookcom":1}}, function() {});
I've tried using update, updateById, findAndModify methods but it still throws the same error.
Inserting works fine, so I'm not sure what's going on. How do I update a record?