diff options
| author | Sean Fridman <fridman@mail.sfsu.edu> | 2015-04-08 14:27:30 -0400 |
|---|---|---|
| committer | Sean Fridman <fridman@mail.sfsu.edu> | 2015-04-08 14:27:30 -0400 |
| commit | 88d83bc72eb7162dc8877de1aaf5269ee10e41bc (patch) | |
| tree | 2639685dc84f9b9c6a70e4dac367ce42c773b8f1 /app/node_modules/okdb/index.js | |
| parent | f768fc2d247988bafc80f43bda3a4a1d89a31adb (diff) | |
Implement FSDB.create
Diffstat (limited to 'app/node_modules/okdb/index.js')
| -rw-r--r-- | app/node_modules/okdb/index.js | 9 |
1 files changed, 7 insertions, 2 deletions
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) { |
