New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mongodb-promise

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongodb-promise - npm Package Compare versions

Comparing version

to
0.0.4

2

lib/collection.js

@@ -76,3 +76,3 @@ var Q = require('q');

} else {
deferred.resolve(result);
deferred.resolve(new Collection(result));
}

@@ -79,0 +79,0 @@ });

{
"name": "mongodb-promise",
"version": "0.0.3",
"version": "0.0.4",
"description": "A mongodb-native promise library",

@@ -5,0 +5,0 @@ "main": "./lib",

@@ -12,5 +12,5 @@ mongodb-promise

```js
// Obtaining a connection
var mp = require('mongodb-promise');
// Obtaining a connection
mp.MongoClient.connect("mongodb://127.0.0.1:27017/test").then(function(db){

@@ -49,13 +49,10 @@ db.close().then(console.log('success'));

.then(function(db){
return db.collection('test')
.then(function(col) {
return col.find({a : 1})
.then(function(cursor){
return cursor.toArray();
})
.then(function(items) {
console.log(items);
db.close().then(console.log('success'));
})
})
return db.collection('test')
.then(function(col) {
return col.find({a : 1}).toArray()
.then(function(items) {
console.log(items);
db.close().then(console.log('success'));
})
})
})

@@ -62,0 +59,0 @@ .fail(function(err) {console.log(err)});