-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix MONGOID-5035 Query embedded documents by date field with $gt/gte/…
…lt/lte does not find existing documents (#4942) Co-authored-by: Oleg Pudeyev <[email protected]>
- Loading branch information
Showing
6 changed files
with
130 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
- name: Date field - matches | ||
document: | ||
date_field: 2020-12-22 | ||
query: | ||
date_field: | ||
$gt: 2020-12-21 | ||
matches: true | ||
|
||
- name: Date field - does not match | ||
document: | ||
date_field: 2020-12-21 | ||
query: | ||
date_field: | ||
$gt: 2020-12-21 | ||
matches: false | ||
|
||
- name: Date value in generic field - matches | ||
document: | ||
field: 2020-12-22 | ||
query: | ||
field: | ||
$gt: 2020-12-21 | ||
matches: true | ||
|
||
- name: Date field - does not match | ||
document: | ||
field: 2020-12-21 | ||
query: | ||
field: | ||
$gt: 2020-12-21 | ||
matches: false | ||
|
||
- name: Time value in generic field queried by date - matches | ||
document: | ||
field: 2020-12-22 00:00:00 | ||
query: | ||
field: | ||
$gt: 2020-12-21 | ||
matches: true | ||
|
||
- name: Time value in generic field queried by date - does not match | ||
document: | ||
field: 2020-12-21 00:00:00 | ||
query: | ||
field: | ||
$gt: 2020-12-21 | ||
matches: false | ||
|
||
- name: Time value in generic field - matches | ||
document: | ||
field: 2020-12-22 00:00:00 | ||
query: | ||
field: | ||
$gt: 2020-12-21 00:00:00 | ||
matches: true | ||
|
||
- name: Time value in generic field - does not match | ||
document: | ||
field: 2020-12-21 00:00:00 | ||
query: | ||
field: | ||
$gt: 2020-12-21 00:00:00 | ||
matches: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
- name: Date field - matches | ||
document: | ||
date_field: 2020-12-22 | ||
query: | ||
date_field: | ||
$gte: 2020-12-21 | ||
matches: true | ||
|
||
- name: Date field - does not match | ||
document: | ||
date_field: 2020-12-20 | ||
query: | ||
date_field: | ||
$gte: 2020-12-21 | ||
matches: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
- name: Date field - matches | ||
document: | ||
date_field: 2020-12-19 | ||
query: | ||
date_field: | ||
$lt: 2020-12-21 | ||
matches: true | ||
|
||
- name: Date field - does not match | ||
document: | ||
date_field: 2020-12-21 | ||
query: | ||
date_field: | ||
$lt: 2020-12-21 | ||
matches: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
- name: Date field - matches | ||
document: | ||
date_field: 2020-12-19 | ||
query: | ||
date_field: | ||
$lte: 2020-12-21 | ||
matches: true | ||
|
||
- name: Date field - does not match | ||
document: | ||
date_field: 2020-12-22 | ||
query: | ||
date_field: | ||
$lte: 2020-12-21 | ||
matches: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
- name: Date field - matches | ||
document: | ||
date_field: 2020-12-22 | ||
query: | ||
date_field: | ||
$ne: 2020-12-21 | ||
matches: true | ||
|
||
- name: Date field - does not match | ||
document: | ||
date_field: 2020-12-21 | ||
query: | ||
date_field: | ||
$ne: 2020-12-21 | ||
matches: false |