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

sql - invalid in the select list because it is not contained in either an aggregate function -

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

How to start daemon on android by adb -