Answer the question
In order to leave comments, you need to log in
How to make such query in mongodb?
I need to look for either the create_date field, but if it's not there, then I'm looking for the create_time field:
Sources_Timings.find(
{
create_date: {
$gte: req.body.date.starting,
$lte: req.body.date.ending
},
create_time: {
$gte: 0,
$lte: 86400000
}
function(err, timings) {
.......
}
)
Answer the question
In order to leave comments, you need to log in
you can do this https://docs.mongodb.com/manual/reference/operator... , of course, but it can be costly in terms of performance
$or: {
create_date: {...},
$and: {
create_date: { $exists: false },
create_time: {...}
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question