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
Post a Comment