I am trying to count a subset of a collection where a subset is defined by an attribute. The code:
User.count()
.where({attribute:{'<':10}})
.exec(function(err, users){
callback(err, users);
});
User.countIt will itself return a total collection counter, but the inclusion of any WHERE clauses seems to consistently return 0. Does the method support countWHERE clauses?
NB I use the Mongodb adapter for both this collection and the default. An “attribute” exists for all models and is populated with numerical data (above and below 10).
source
share