MongoDB, MongoJS gotchas
- authentication mechanism has to be manually set for mongodb 3.0+ version:
db.connection = mongojs(process.env.MONGOLAB_URI || MONGODB, ["users"], {authMechanism: 'ScramSHA1'});
- request JSON has to be manually convert to BSON format also:
eg. object ID should be converted with
mongojs.ObjectId('523209c4561c640000000001')
. especially when updating with a dot notated criteria, update failssilently
The above two probably can be set at somewhere global but I assume MongoDB APIs will change