Skip to content

Commit

Permalink
fix: quering for range ZMS-182 (#742)
Browse files Browse the repository at this point in the history
* quering for range can be done as a single document, otherwise  shows error too

* fix buggy typo introduced in last commit
  • Loading branch information
NickOvt authored Oct 28, 2024
1 parent 6542e5b commit 3804bea
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions lib/handlers/on-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,10 @@ module.exports = server => (mailbox, options, session, callback) => {
break;
}
let entry = !op
? [
{
$gte: value
},
{
$lt: new Date(value.getTime() + 24 * 3600 * 1000)
}
]
? {
$gte: value,
$lt: new Date(value.getTime() + 24 * 3600 * 1000)
}
: {
[op]: value
};
Expand Down Expand Up @@ -263,14 +259,10 @@ module.exports = server => (mailbox, options, session, callback) => {
break;
}
let entry = !op
? [
{
$gte: value
},
{
$lt: new Date(value.getTime() + 24 * 3600 * 1000)
}
]
? {
$gte: value,
$lt: new Date(value.getTime() + 24 * 3600 * 1000)
}
: {
[op]: value
};
Expand Down

0 comments on commit 3804bea

Please sign in to comment.