Answer the question
In order to leave comments, you need to log in
How does $gt and $lt work in mongo?
Help me deal with the keys in $gt and $lt in mongo correctly
I use them to filter by the time of writing to the database.
For example, I want to get data from 8 am yesterday to 8 am today, in which case I have
$gt == date yesterday 08:00:00
$lt == date today 08:00:00
What exactly will the database return to me, all records starting from 8:00:00 inclusive to 8:00:00 or a record that was made exactly at 08:00:00 will not be in the answer?
So will $lt == 08:00:00 return records up to and including 08:00:00 from a document created on 08:00:00 or will the last document be a document created at 07:59:59?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question