File tree Expand file tree Collapse file tree 1 file changed +22
-12
lines changed Expand file tree Collapse file tree 1 file changed +22
-12
lines changed Original file line number Diff line number Diff line change @@ -18,10 +18,14 @@ The query text should be a valid MongoDB Aggregate pipeline - an array consistin
18
18
"$match" : {
19
19
"createdTime" : {
20
20
"$gt" : {
21
- "$numberLong" : " $__from"
21
+ "$date" : {
22
+ "$numberLong" : " $__from"
23
+ }
22
24
},
23
25
"$lt" : {
24
- "$numberLong" : " $__to"
26
+ "$date" : {
27
+ "$numberLong" : " $__to"
28
+ }
25
29
}
26
30
}
27
31
}
@@ -30,18 +34,24 @@ The query text should be a valid MongoDB Aggregate pipeline - an array consistin
30
34
```
31
35
In JavaScript query, you need to follow the format ` db.<collection-name>.aggregate([<json-query>]) ` . As shows in the following example.
32
36
``` js
33
- db .transactions .aggregate ({
34
- " $match" : {
35
- " createdTime" : {
36
- " $gt" : {
37
- " $numberLong" : " $__from"
38
- },
39
- " $lt" : {
40
- " $numberLong" : " $__to"
37
+ db .transactions .aggregate ([
38
+ {
39
+ " $match" : {
40
+ " createdTime" : {
41
+ " $gt" : {
42
+ " $date" : {
43
+ " $numberLong" : " $__from"
44
+ }
45
+ },
46
+ " $lt" : {
47
+ " $date" : {
48
+ " $numberLong" : " $__to"
49
+ }
50
+ }
41
51
}
42
52
}
43
53
}
44
- } );
54
+ ] );
45
55
```
46
56
47
57
You can also use the ` "$from" ` , ` "$to" ` and ` "$dateBucketCount" ` (number of intervals in the time range) conventions originated from a legacy plugin.
@@ -142,4 +152,4 @@ unzip haohanyang-mongodb-datasource-<version>.zip -d mongodb-datasource
142
152
``` bash
143
153
chmod 0755 mongodb-datasource/gpx_mongodb_datasource_*
144
154
```
145
- * Create/start the docker container as descriped in the [ example docker compose file] ( /docker-compose.prod.yaml )
155
+ * Create/start the docker container as descriped in the [ example docker compose file] ( /docker-compose.prod.yaml )
You can’t perform that action at this time.
0 commit comments