diff --git a/index.js b/index.js index 24d712a3..dea9f590 100644 --- a/index.js +++ b/index.js @@ -1221,7 +1221,7 @@ function MongoSnapshot(id, version, type, data, meta, opLink) { this.v = version; this.type = type; this.data = data; - if (meta) this.m = meta; + this.m = meta == null ? null : meta; if (opLink) this._opLink = opLink; } diff --git a/package.json b/package.json index c17b1126..a546abee 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "expect.js": "^0.3.1", "istanbul": "^0.4.2", "mocha": "^2.3.3", - "sharedb-mingo-memory": "^1.0.1" + "sharedb-mingo-memory": "^1.0.2" }, "scripts": { "test": "node_modules/.bin/mocha", diff --git a/test/test_mongo.js b/test/test_mongo.js index d5ee6f67..5530e6a5 100644 --- a/test/test_mongo.js +++ b/test/test_mongo.js @@ -353,7 +353,7 @@ describe('mongo db connection', function() { }); it('commit and query', function(done) { - var snapshot = {type: 'json0', v: 1, data: {}, id: "test"}; + var snapshot = {type: 'json0', v: 1, data: {}, id: "test", m: null}; var db = this.db; db.commit('testcollection', snapshot.id, {v: 0, create: {}}, snapshot, null, function(err) {