Skip to content

Commit

Permalink
Replace non-standard whitespaces with normal ones
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesMGreene committed Aug 10, 2017
1 parent 957492d commit 42fe080
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,10 @@ When a field in a document is an array, NestDB first tries to see if the query v

```js
// 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
})

Expand Down
4 changes: 2 additions & 2 deletions browser-version/out/nestdb.js
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,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;
}
});
Expand Down Expand Up @@ -1894,7 +1894,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;
Expand Down
2 changes: 1 addition & 1 deletion lib/datastore.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,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;
}
});
Expand Down
2 changes: 1 addition & 1 deletion lib/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions test/model.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 });

Expand Down

0 comments on commit 42fe080

Please sign in to comment.