mongo-control
Advanced tools
Comparing version 1.0.72 to 1.0.73
@@ -526,7 +526,7 @@ var MongoClient = require('mongodb').MongoClient | ||
if(params.next) { | ||
var nextObj | ||
var nextObj = {$or: []} | ||
if(reMongoId.test(params.next)) { | ||
nextObj.$or.push({$gt: new ObjectID(params.next)}) | ||
nextObj.$or.push({_id: {$gt: new ObjectID(params.next)}}) | ||
} else if(typeof params.next === 'number') { | ||
nextObj.$or.push({$lt: params.next}) | ||
nextObj.$or.push({_id: {$gt: params.next}}) | ||
} | ||
@@ -540,7 +540,7 @@ | ||
} else if(params.prev) { | ||
var prevObj = {$or: [{$lt: params.prev}]} | ||
var prevObj = {$or: []} | ||
if(reMongoId.test(params.prev)) { | ||
prevObj.$or.push({$lt: new ObjectID(params.prev)}) | ||
prevObj.$or.push({_id: {$lt: new ObjectID(params.prev)}}) | ||
} else if(typeof params.prev === 'number') { | ||
prevObj.$or.push({$lt: params.prev}) | ||
prevObj.$or.push({_id: {$lt: params.prev}}) | ||
} | ||
@@ -547,0 +547,0 @@ |
{ | ||
"name": "mongo-control", | ||
"version": "1.0.72", | ||
"version": "1.0.73", | ||
"description": "Simple functions to control mongo", | ||
@@ -5,0 +5,0 @@ "main": "mongo.control.js", |
31657