Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
aheckmann committed Nov 19, 2011
1 parent 1625371 commit 088de61
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions lib/query.js
Expand Up @@ -405,32 +405,26 @@ Query.prototype.elemMatch = function (path, criteria) {
};
});

// TODO
Query.prototype.explain = function () {
throw new Error("Unimplemented");
};

// TODO Add being able to skip casting -- e.g., this would be nice for scenarios like
// if you're migrating to usernames from user id numbers:
// query.where('user_id').in([4444, 'brian']);

// TODO "immortal" cursors - (only work on capped collections)
// TODO geoNear command
/**
* @private
*/

function me () { return this }

/**
* Spatial queries
*/

// query.within.box()
// query.within.center()
var within = 'within $within'.split(' ');
within.push('wherein', '$wherein'); // deprecated
within.push('wherein', '$wherein'); // deprecated, an old mistake possibly?
within.forEach(function (getter) {
Object.defineProperty(Query.prototype, getter, {
get: me
});
});



Query.prototype['$box'] =
Query.prototype.box = function (path, val) {
if (arguments.length === 1) {
Expand Down Expand Up @@ -1263,6 +1257,17 @@ Query.prototype.populate = function (path, fields, conditions) {
return this;
};

// TODO
Query.prototype.explain = function () {
throw new Error("Unimplemented");
};

// TODO Add being able to skip casting -- e.g., this would be nice for scenarios like
// if you're migrating to usernames from user id numbers:
// query.where('user_id').in([4444, 'brian']);
// TODO "immortal" cursors - (only work on capped collections)
// TODO geoNear command

/**
* Exports.
*/
Expand Down

0 comments on commit 088de61

Please sign in to comment.