Comparing version 1.0.47 to 1.0.48
13
mongo.js
@@ -28,8 +28,9 @@ const MongoDB = require('mongodb'); | ||
if (filter.sort) | ||
options.sort = filter.sort; | ||
if (!filter.sort) | ||
filter.sort = {"_id": 1}; | ||
builder.db.$debug && builder.db.$debug({ collection: client.$database + '.' + opt.table, condition: filter.where, options: options }); | ||
client.db(client.$database).collection(opt.table).find(filter.where, options).sort({"_id" : 1}).allowDiskUse().toArray(function(err, response) { | ||
client.db(client.$database).collection(opt.table).find(filter.where, options).sort(filter.sort).allowDiskUse().toArray(function(err, response) { | ||
@@ -130,4 +131,4 @@ client.close(); | ||
if (filter.sort) | ||
options.sort = filter.sort; | ||
if (!filter.sort) | ||
filter.sort = {"_id": 1}; | ||
@@ -143,3 +144,3 @@ builder.db.$debug && builder.db.$debug({ collection: client.$database + '.' + opt.table, condition: filter.where, options: options }); | ||
} else { | ||
db.find(filter.where, options).sort({"_id" : 1}).allowDiskUse().toArray(function(err, response) { | ||
db.find(filter.where, options).sort(filter.sort).allowDiskUse().toArray(function(err, response) { | ||
client.close(); | ||
@@ -146,0 +147,0 @@ if (!err && builder.$joins) { |
{ | ||
"name": "icorm", | ||
"version": "1.0.47", | ||
"version": "1.0.48", | ||
"description": "Database Management System", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
217831