mongodb nodejs each vs toArray
I've had a quick look around and not found anything that's satisfied me with an answer but basically I've started to use node.js with express and mongodb to create a webapi rather than the usual .Net MVC Web API route. One thing I've noted though is in order to return a collection of results I'm doing it in a rather bulky way, or that's how it feels at least. app.get('/property', function (req, res) { var propArray = []; MongoClient.connect(settings.connection, function (err, db) { if (err) throw err; var properties = db.collection("PROPERTIES"); var searchParams = { Active: true, Deleted: