diff --git a/README.md b/README.md index f50a1b12..23215b7f 100755 --- a/README.md +++ b/README.md @@ -281,10 +281,10 @@ When a field in a document is an array, NeDB first tries to see if the query val ```javascript // Exact match -db.find({ satellites: ['Phobos', 'Deimos'] }, function (err, docs) { +db.find({ satellites: ['Phobos', 'Deimos'] }, function (err, docs) { // docs contains Mars }) -db.find({ satellites: ['Deimos', 'Phobos'] }, function (err, docs) { +db.find({ satellites: ['Deimos', 'Phobos'] }, function (err, docs) { // docs is empty }) diff --git a/browser-version/out/nedb.js b/browser-version/out/nedb.js index e9655bf9..cd996095 100755 --- a/browser-version/out/nedb.js +++ b/browser-version/out/nedb.js @@ -1379,7 +1379,7 @@ Datastore.prototype.getCandidates = function (query, dontExpireStaleDocs, callba docs.forEach(function (doc) { var valid = true; ttlIndexesFieldNames.forEach(function (i) { - if (doc[i] !== undefined && util.isDate(doc[i]) && Date.now() > doc[i].getTime() + self.ttlIndexes[i] * 1000) { + if (doc[i] !== undefined && util.isDate(doc[i]) && Date.now() > doc[i].getTime() + self.ttlIndexes[i] * 1000) { valid = false; } }); @@ -2549,7 +2549,7 @@ lastStepModifierFunctions.$max = function (obj, field, value) { * Updates the value of the field, only if specified field is smaller than the current value of the field */ lastStepModifierFunctions.$min = function (obj, field, value) { - if (typeof obj[field] === 'undefined') {  + if (typeof obj[field] === 'undefined') { obj[field] = value; } else if (value < obj[field]) { obj[field] = value; diff --git a/lib/datastore.js b/lib/datastore.js index 4b978ad3..f972cf61 100755 --- a/lib/datastore.js +++ b/lib/datastore.js @@ -314,7 +314,7 @@ Datastore.prototype.getCandidates = function (query, dontExpireStaleDocs, callba docs.forEach(function (doc) { var valid = true; ttlIndexesFieldNames.forEach(function (i) { - if (doc[i] !== undefined && util.isDate(doc[i]) && Date.now() > doc[i].getTime() + self.ttlIndexes[i] * 1000) { + if (doc[i] !== undefined && util.isDate(doc[i]) && Date.now() > doc[i].getTime() + self.ttlIndexes[i] * 1000) { valid = false; } }); diff --git a/lib/model.js b/lib/model.js index 0aa9e928..f4cd6342 100755 --- a/lib/model.js +++ b/lib/model.js @@ -401,7 +401,7 @@ lastStepModifierFunctions.$max = function (obj, field, value) { * Updates the value of the field, only if specified field is smaller than the current value of the field */ lastStepModifierFunctions.$min = function (obj, field, value) { - if (typeof obj[field] === 'undefined') {  + if (typeof obj[field] === 'undefined') { obj[field] = value; } else if (value < obj[field]) { obj[field] = value; diff --git a/test/model.test.js b/test/model.test.js index f7002ed9..21bb7cf2 100755 --- a/test/model.test.js +++ b/test/model.test.js @@ -383,7 +383,7 @@ describe('Model', function () { it("Doesn't replace a falsy field by an object when recursively following dot notation", function () { var obj = { nested: false } - , updateQuery = { $set: { "nested.now": 'it is' } } + , updateQuery = { $set: { "nested.now": 'it is' } } , modified = model.modify(obj, updateQuery); assert.deepEqual(modified, { nested: false }); // Object not modified as the nested field doesn't exist @@ -430,7 +430,7 @@ describe('Model', function () { assert.deepEqual(modified, { yup: 'yes', nested: {} }); }); - it("When unsetting nested fields, should not create an empty parent to nested field", function () { + it("When unsetting nested fields, should not create an empty parent to nested field", function () { var obj = model.modify({ argh: true }, { $unset: { 'bad.worse': true } }); assert.deepEqual(obj, { argh: true });