Mongodb query to node.js format -


db.gpsvalues.aggregate([   {$sort:{"timestamp":1}},   {$group:{     "_id":"$empid",     lastupdated:{$last:"$timestamp"},     latitude:{$last:"$latitude"},     longitude:{$last:"$longitude"}   }} ]) 

this query returns expected value in mongodb. want same values node.js api call? can tell me how make node.js api? in advance

you may check mongojs node.js client supports aggregation mentionned in manual. personnally have not used feature yet should work expected.


Comments

Popular posts from this blog

AbotX : How do you create a parallel crawler that stays on and can be added to at run time from new requests -

testing - Detect whether test has failed within fixture -

android - Create single AAR file from multiple modules using Gradle -