From 88d83bc72eb7162dc8877de1aaf5269ee10e41bc Mon Sep 17 00:00:00 2001 From: Sean Fridman Date: Wed, 8 Apr 2015 14:27:30 -0400 Subject: Implement FSDB.create --- app/node_modules/okdb/index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'app/node_modules/okdb/index.js') diff --git a/app/node_modules/okdb/index.js b/app/node_modules/okdb/index.js index 3089411..5368e4a 100644 --- a/app/node_modules/okdb/index.js +++ b/app/node_modules/okdb/index.js @@ -72,8 +72,13 @@ FSDB.prototype.put = function(collection, query, data) { } }; -FSDB.prototype.create = function(collection, id, data) { - throw new Error('Not implemented!'); +FSDB.prototype.create = function(collection, data) { + var created = this._db(collection) + .chain() + .push(data) + .last() + .value(); + return this._resolve(created); }; FSDB.prototype.remove = function(collection, id, data) { -- cgit v1.2.3-70-g09d2