Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mongojs

Package Overview
Dependencies
Maintainers
4
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongojs - npm Package Compare versions

Comparing version 2.2.0 to 2.2.1

test/test-aggregate-options.js

7

lib/collection.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc