|
|
@ -46,9 +46,11 @@ Cursor.prototype.sort = function(sortQuery) { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Get all matching elements |
|
|
|
* Get all matching elements |
|
|
|
|
|
|
|
* This is an internal function, use exec which uses the executor |
|
|
|
|
|
|
|
* |
|
|
|
* @param {Function} callback - Signature: err, results |
|
|
|
* @param {Function} callback - Signature: err, results |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
Cursor.prototype.exec = function(callback) { |
|
|
|
Cursor.prototype.exec = function(callback) { |
|
|
|
var candidates = this.db.getCandidates(this.query) |
|
|
|
var candidates = this.db.getCandidates(this.query) |
|
|
|
, res = [], added = 0, skipped = 0, self = this |
|
|
|
, res = [], added = 0, skipped = 0, self = this |
|
|
|
, i |
|
|
|
, i |
|
|
@ -93,6 +95,12 @@ Cursor.prototype.sort = function(sortQuery) { |
|
|
|
return callback(null, res); |
|
|
|
return callback(null, res); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Cursor.prototype.exec = function () {
|
|
|
|
|
|
|
|
// console.log("=============IN EXEC");
|
|
|
|
|
|
|
|
// this.db.executor.push({ this: this, fn: this._exec, arguments: arguments });
|
|
|
|
|
|
|
|
// };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Interface
|
|
|
|
// Interface
|
|
|
|
module.exports = Cursor; |
|
|
|
module.exports = Cursor; |