Comparing version 2.2.0 to 2.2.1
@@ -243,2 +243,4 @@ var mongodb = require('mongodb') | ||
var cb | ||
var opts | ||
var pipeline = Array.prototype.slice.call(arguments) | ||
@@ -249,3 +251,4 @@ if (typeof pipeline[pipeline.length - 1] === 'function') { | ||
if (pipeline.length === 1 && Array.isArray(pipeline[0])) { | ||
if ((pipeline.length === 1 || pipeline.length === 2) && Array.isArray(pipeline[0])) { | ||
opts = pipeline[1] | ||
pipeline = pipeline[0] | ||
@@ -260,3 +263,3 @@ } | ||
cb(null, collection.aggregate(pipeline)) | ||
cb(null, collection.aggregate(pipeline, opts)) | ||
}) | ||
@@ -263,0 +266,0 @@ }) |
@@ -61,3 +61,5 @@ var util = require('util') | ||
array.push(obj) | ||
loop() | ||
// Fix for #270 RangeError: Maximum call stack size exceeded using Collection.find | ||
setImmediate(loop) | ||
}) | ||
@@ -78,3 +80,5 @@ } | ||
array.push(mapfn(obj)) | ||
loop() | ||
// Fix for #270 RangeError: Maximum call stack size exceeded using Collection.find | ||
setImmediate(loop) | ||
}) | ||
@@ -95,3 +99,5 @@ } | ||
if (!obj) return | ||
loop() | ||
// Fix for #270 RangeError: Maximum call stack size exceeded using Collection.find | ||
setImmediate(loop) | ||
}) | ||
@@ -98,0 +104,0 @@ } |
@@ -9,3 +9,3 @@ { | ||
], | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"repository": "git://github.com/mafintosh/mongojs.git", | ||
@@ -35,3 +35,2 @@ "author": "Mathias Buus Madsen <mathiasbuus@gmail.com>", | ||
"parse-mongo-url": "^1.1.0", | ||
"pump": "^1.0.0", | ||
"readable-stream": "^2.0.2", | ||
@@ -56,5 +55,5 @@ "thunky": "^0.1.0", | ||
"coordinates": [ | ||
48.22870899999999, | ||
16.3955498 | ||
48.2287157, | ||
16.3955287 | ||
] | ||
} |
@@ -253,3 +253,5 @@ # mongojs | ||
#####`db.collection.aggregate([pipeline], [callback])` | ||
#####`db.collection.aggregate([pipeline], [options], [callback])` | ||
https://docs.mongodb.org/manual/reference/method/db.collection.aggregate/ | ||
#####`db.collection.aggregate([pipelineStep], [pipelineStep], [pipelineStep], ..., [callback])` | ||
@@ -256,0 +258,0 @@ |
@@ -12,5 +12,6 @@ var insert = require('./insert') | ||
name: 'Lapras', type: 'water' | ||
}], function (db, t, done) { | ||
}], function (db, t) { | ||
db.a.aggregate({$group: {_id: '$type'}}, function (err, types) { | ||
console.log(err, types) | ||
t.error(err) | ||
var arr = types.map(function (x) { return x._id }) | ||
@@ -17,0 +18,0 @@ t.equal(types.length, 2) |
@@ -9,3 +9,3 @@ var insert = require('./insert') | ||
name: 'Lapras', type: 'water' | ||
}], function (db, t, done) { | ||
}], function (db, t) { | ||
var cursor = db.a.find().sort({name: 1}) | ||
@@ -12,0 +12,0 @@ cursor.next(function (err, obj1) { |
Sorry, the diff of this file is not supported yet
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
130117
8
90
2086
383
- Removedpump@^1.0.0
- Removedend-of-stream@1.4.4(transitive)
- Removedpump@1.0.3(transitive)