From 76f093f86dda05c10c085405924b0a305e616bf6 Mon Sep 17 00:00:00 2001 From: Louis Chatriot Date: Wed, 29 May 2013 13:38:01 +0200 Subject: [PATCH] Added dependency to bst --- lib/datastore.js | 5 +++++ package.json | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/datastore.js b/lib/datastore.js index 7495892..85d76b1 100644 --- a/lib/datastore.js +++ b/lib/datastore.js @@ -41,6 +41,7 @@ Datastore.prototype.ensureIndex = function (options) { options.datastore = this; this.indexes[options.fieldName] = new Index(options); + this.indexes[options.fieldName].insert(this.data); return true; }; @@ -362,4 +363,8 @@ Datastore.prototype.remove = function () { }; + + + + module.exports = Datastore; diff --git a/package.json b/package.json index fcdbc30..490aa47 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,8 @@ }, "dependencies": { "async": "~0.2.8", - "underscore": "~1.4.4" + "underscore": "~1.4.4", + "binary-search-tree": "~0.1.1" }, "devDependencies": { "chai": "1.0.x",