Skip to content

Commit 1d512d7

Browse files
authored
Fix error
1 parent 2243a2a commit 1d512d7

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

README.md

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@ The query text should be a valid MongoDB Aggregate pipeline - an array consistin
1818
"$match": {
1919
"createdTime": {
2020
"$gt": {
21-
"$numberLong": "$__from"
21+
"$date": {
22+
"$numberLong": "$__from"
23+
}
2224
},
2325
"$lt": {
24-
"$numberLong": "$__to"
26+
"$date": {
27+
"$numberLong": "$__to"
28+
}
2529
}
2630
}
2731
}
@@ -30,18 +34,24 @@ The query text should be a valid MongoDB Aggregate pipeline - an array consistin
3034
```
3135
In JavaScript query, you need to follow the format `db.<collection-name>.aggregate([<json-query>])`. As shows in the following example.
3236
```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+
}
4151
}
4252
}
4353
}
44-
});
54+
]);
4555
```
4656

4757
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
142152
```bash
143153
chmod 0755 mongodb-datasource/gpx_mongodb_datasource_*
144154
```
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)

0 commit comments

Comments
 (0)