|
|
@ -75,6 +75,8 @@ Datastore.treatRawData = function (rawData) { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* Insert a new document |
|
|
|
* Insert a new document |
|
|
|
* @param {Function} cb Optional callback, signature: err, insertedDoc |
|
|
|
* @param {Function} cb Optional callback, signature: err, insertedDoc |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @api private Use Datastore.insert which has the same signature |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
Datastore.prototype._insert = function (newDoc, cb) { |
|
|
|
Datastore.prototype._insert = function (newDoc, cb) { |
|
|
|
var callback = cb || function () {} |
|
|
|
var callback = cb || function () {} |
|
|
@ -181,6 +183,8 @@ Datastore.prototype.persistWholeDatabase = function (data, cb) { |
|
|
|
* options.multi If true, can update multiple documents (defaults to false) |
|
|
|
* options.multi If true, can update multiple documents (defaults to false) |
|
|
|
* options.upsert If true, document is inserted if the query doesn't match anything |
|
|
|
* options.upsert If true, document is inserted if the query doesn't match anything |
|
|
|
* @param {Function} cb Optional callback, signature: err, numReplaced, upsert (set to true if the update was in fact an upsert) |
|
|
|
* @param {Function} cb Optional callback, signature: err, numReplaced, upsert (set to true if the update was in fact an upsert) |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @api private Use Datastore.update which has the same signature |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
Datastore.prototype._update = function (query, updateQuery, options, cb) { |
|
|
|
Datastore.prototype._update = function (query, updateQuery, options, cb) { |
|
|
|
var callback |
|
|
|
var callback |
|
|
@ -246,6 +250,8 @@ Datastore.prototype.update = function () { |
|
|
|
* @param {Object} options Optional options |
|
|
|
* @param {Object} options Optional options |
|
|
|
* options.multi If true, can update multiple documents (defaults to false) |
|
|
|
* options.multi If true, can update multiple documents (defaults to false) |
|
|
|
* @param {Function} cb Optional callback, signature: err, numRemoved |
|
|
|
* @param {Function} cb Optional callback, signature: err, numRemoved |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @api private Use Datastore.remove which has the same signature |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
Datastore.prototype._remove = function (query, options, cb) { |
|
|
|
Datastore.prototype._remove = function (query, options, cb) { |
|
|
|
var callback |
|
|
|
var callback |
|
|
|