javascript - Mongodb terminal command working, not working correctly in node js -



javascript - Mongodb terminal command working, not working correctly in node js -

hello have devised next query in terminal mongodb database.

db.champions.find().sort({wins: -1}).pretty()

this correctly outputs in decesnding order according wins

i have next code in node js

champion.find().sort({wins: -1}).exec(function (err, championdata) { if (err) homecoming console.error(err); res.json(championdata) });

the response sent controller outputs info via angular html doc. doesn't output in ordered format specified (by wins decending)

can node js / mongodb guru's please tell me im going wrong. thanks!

sorry stupid question, angular ordering results. sorry!

javascript node.js mongodb

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -