@dreamingfurther and I are trying to conditionally make a request for all models of a given type
Ideally we would like to do something like.
if (User.count === 0) {
User.find()
}
We’ve come up with a solution using a filter to count the records but it seems hacky:
var count = 0;
User.filter(function() {
count+=1;
});
if (count === 0) {
User.find()
}
Does anyone have any suggestions on how to handle this?