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

How to start daemon on android by adb -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

testing - Detect whether test has failed within fixture -