Merge branch 'patch-1' of github.com:vladikoff/nedb into vladikoff-patch-1

pull/2/head
Louis Chatriot 12 years ago
commit a15d318244
  1. 2
      benchmarks/commonUtilities.js
  2. 2
      lib/datastore.js
  3. 2
      lib/indexes.js
  4. 4
      lib/model.js

@ -46,7 +46,7 @@ module.exports.getConfiguration = function (benchDb) {
}); });
return { n: n, d: d, program: program }; return { n: n, d: d, program: program };
} };
/** /**

@ -28,7 +28,7 @@ function Datastore (options) {
this.pipeline = false; // Default this.pipeline = false; // Default
} else { } else {
options = options || {}; options = options || {};
filename = options.filename filename = options.filename;
this.inMemoryOnly = options.inMemoryOnly || false; this.inMemoryOnly = options.inMemoryOnly || false;
this.pipeline = options.pipeline || false; this.pipeline = options.pipeline || false;
} }

@ -94,7 +94,7 @@ Index.prototype.insertMultipleDocs = function (docs) {
* O(log(n)) * O(log(n))
*/ */
Index.prototype.remove = function (doc) { Index.prototype.remove = function (doc) {
var key, self = this var key, self = this;
if (util.isArray(doc)) { doc.forEach(function (d) { self.remove(d); }); return; } if (util.isArray(doc)) { doc.forEach(function (d) { self.remove(d); }); return; }

@ -572,8 +572,8 @@ function matchQueryPart (obj, queryKey, queryValue) {
// or only normal fields. Mixed objects are not allowed // or only normal fields. Mixed objects are not allowed
if (queryValue !== null && typeof queryValue === 'object') { if (queryValue !== null && typeof queryValue === 'object') {
keys = Object.keys(queryValue); keys = Object.keys(queryValue);
firstChars = _.map(keys, function (item) { return item[0]; }) firstChars = _.map(keys, function (item) { return item[0]; });
dollarFirstChars = _.filter(firstChars, function (c) { return c === '$'; }) dollarFirstChars = _.filter(firstChars, function (c) { return c === '$'; });
if (dollarFirstChars.length !== 0 && dollarFirstChars.length !== firstChars.length) { if (dollarFirstChars.length !== 0 && dollarFirstChars.length !== firstChars.length) {
throw "You cannot mix operators and normal fields"; throw "You cannot mix operators and normal fields";

Loading…
Cancel
Save