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