Comparing version 0.7.11 to 0.7.12
@@ -100,3 +100,3 @@ var fs = require('fs') | ||
if (!options.fieldName) { return callback({ missingFieldName: true }); } | ||
if (this.indexes[options.fieldName]) { return callback(); } | ||
if (this.indexes[options.fieldName]) { return callback(null); } | ||
@@ -112,3 +112,3 @@ this.indexes[options.fieldName] = new Index(options); | ||
return callback(); | ||
return callback(null); | ||
}; | ||
@@ -258,3 +258,3 @@ | ||
// In-memory only datastore | ||
if (self.inMemoryOnly) { return callback(); } | ||
if (self.inMemoryOnly) { return callback(null); } | ||
@@ -342,3 +342,3 @@ customUtils.ensureDirectoryExists(path.dirname(self.filename), function (err) { | ||
if (toPersist.length === 0) { return callback(); } | ||
if (toPersist.length === 0) { return callback(null); } | ||
@@ -362,3 +362,3 @@ fs.writeFile(this.filename, toPersist, function (err) { return callback(err); }); | ||
// In-memory only datastore | ||
if (self.inMemoryOnly) { return callback(); } | ||
if (self.inMemoryOnly) { return callback(null); } | ||
@@ -371,3 +371,3 @@ self.datafileSize += newDocs.length; | ||
if (toPersist.length === 0) { return callback(); } | ||
if (toPersist.length === 0) { return callback(null); } | ||
@@ -374,0 +374,0 @@ fs.appendFile(self.filename, toPersist, 'utf8', function (err) { |
{ | ||
"name": "nedb", | ||
"version": "0.7.11", | ||
"version": "0.7.12", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "tldr.io", |
@@ -141,3 +141,3 @@ # NeDB (Node embedded database) | ||
#### Comparison operators ($lt, $lte, $gt, $gte, $in, $nin, $ne) | ||
#### Operators ($lt, $lte, $gt, $gte, $in, $nin, $ne, $exists) | ||
The syntax is `{ field: { $op: value } }` where `$op` is any comparison operator: | ||
@@ -149,2 +149,3 @@ | ||
* `$ne`, `$nin`: not equal, not a member of | ||
* `$exists`: checks whether the document posses the property `field`. `value` should be true or false | ||
@@ -166,2 +167,7 @@ ```javascript | ||
}); | ||
// Using $exists | ||
db.find({ satellites: { $exists: true } }, function (err, docs) { | ||
// docs contains only Mars | ||
}); | ||
``` | ||
@@ -168,0 +174,0 @@ |
Sorry, the diff of this file is too big to display
224732
421