From da177166dc249e43b35c66ba8fbc876a500e414b Mon Sep 17 00:00:00 2001 From: Konstantin Baierer Date: Wed, 12 Apr 2017 22:05:29 +0200 Subject: [PATCH] Replace non-breaking-space with real space c.f. https://github.com/louischatriot/nedb/pull/501 --- README.md | 4 ++-- lib/model.js | 2 +- test/model.test.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 305235db..62bf9ccf 100755 --- a/README.md +++ b/README.md @@ -269,10 +269,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/lib/model.js b/lib/model.js index ec7b85a9..0064dc9c 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 c783bcea..cee0aead 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 });