Skip to content

Commit

Permalink
admin: use {$ne:null} instead of {$exists:true} for listing contributors
Browse files Browse the repository at this point in the history
in admin. Who knew $exists had such poor performance!
https://groups.google.com/forum/#!topic/mongodb-user/FKJWoi3lb9I
@SabreCat @wc8, admin page should be snappier now
  • Loading branch information
lefnire committed Jan 5, 2014
1 parent 6c6f364 commit eda79a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/controllers/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ api.getMember = function(req, res) {
}

api.listMembers = function(req, res) {
User.find({'contributor.level':{$exists:true}})
User.find({'contributor.level':{$ne:null}})// {$exists:true} causes terrible performance http://goo.gl/GCxzC9
.select('contributor balance profile.name')
.sort('contributor.text')
.exec(function(err, users){
Expand Down

0 comments on commit eda79a7

Please sign in to comment.