Last active
August 29, 2015 14:01
-
-
Save reggi/4ed1d63b12db2456633a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mongoConnect(mongoUrl) | |
.then(function(db) { | |
var flow = {}; | |
flow.db = db; | |
return flow; | |
}) | |
.then(function(flow) { | |
console.log("hello world"); | |
return flow; | |
}) | |
.then(function(flow) { | |
flow.db.close(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mongoConnect(mongoUrl) | |
.then(function(db) { | |
var customers = db.collection("customers"); | |
return Q.denodeify(customers.find().toArray); | |
}) | |
.then(function(customers) { | |
console.log(customers.length); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment