Answer the question
In order to leave comments, you need to log in
How to return from the database of users where a certain field is filled in mongoose?
i did like this, but it returns everyone where the timer field is even empty
Answer the question
In order to leave comments, you need to log in
mongoosejs.com/docs/api.html#query_Query-exists
Isn't it?
// { name: { $exists: true }}
Thing.where('name').exists()
Thing.where('name').exists(true)
Thing.find().exists('name')
// { name: { $exists: false }}
Thing.where('name').exists(false);
Thing.find().exists('name', false);
If I'm not mistaken something like this
comunicate.find({
timer: {
$exists: true
}
}, callback)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question