diff --git a/packages/java-shell/build.gradle b/packages/java-shell/build.gradle index 223dbe6a28..e4536a053b 100644 --- a/packages/java-shell/build.gradle +++ b/packages/java-shell/build.gradle @@ -27,6 +27,6 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" testImplementation group: 'junit', name: 'junit', version: '4.12' implementation group: 'org.graalvm.js', name: 'js', version: '22.0.0.2' - implementation group: 'org.mongodb', name: 'mongodb-driver-sync', version: '4.5.1' + implementation group: 'org.mongodb', name: 'mongodb-driver-sync', version: '4.7.1' implementation group: 'org.apache.commons', name: 'commons-text', version: '1.8' } diff --git a/packages/java-shell/src/test/resources/cursor/tailable.expected.txt b/packages/java-shell/src/test/resources/cursor/tailable.expected.txt index 2876431e2f..87179f481e 100644 --- a/packages/java-shell/src/test/resources/cursor/tailable.expected.txt +++ b/packages/java-shell/src/test/resources/cursor/tailable.expected.txt @@ -1 +1 @@ -com.mongodb.MongoQueryException: Query failed with error code 2 and error message 'error processing query: ns=admin.collTree: $and +com.mongodb.MongoQueryException: Query failed with error code 2 with name 'BadValue' and error message 'error processing query: ns=admin.collTree: $and diff --git a/packages/java-shell/src/test/resources/db/createCollectionWithTimeseries.expected.1.txt b/packages/java-shell/src/test/resources/db/createCollectionWithTimeseries.expected.1.txt index 6db45246ea..78114caed3 100644 --- a/packages/java-shell/src/test/resources/db/createCollectionWithTimeseries.expected.1.txt +++ b/packages/java-shell/src/test/resources/db/createCollectionWithTimeseries.expected.1.txt @@ -1,3 +1,3 @@ com.mongodb.MongoCommandException: Command failed with error 40415 (Location40415): 'BSON field 'create.expireAfterSeconds' is an unknown field.' on server %mongohostport%. The full response is {"ok": 0.0, "errmsg": "BSON field 'create.expireAfterSeconds' is an unknown field.", "code": 40415, "codeName": "Location40415"} { "acknowledged": true, "insertedId": } -{ "timestamp": {"$date": {"$numberLong": "1621296000000"}} } \ No newline at end of file +{ "timestamp": {"$date": {"$numberLong": "1662681600000"}} } \ No newline at end of file diff --git a/packages/java-shell/src/test/resources/db/createCollectionWithTimeseries.expected.2.txt b/packages/java-shell/src/test/resources/db/createCollectionWithTimeseries.expected.2.txt index 1011bf8c2a..61aa4edc75 100644 --- a/packages/java-shell/src/test/resources/db/createCollectionWithTimeseries.expected.2.txt +++ b/packages/java-shell/src/test/resources/db/createCollectionWithTimeseries.expected.2.txt @@ -1,3 +1,3 @@ -com.mongodb.MongoCommandException: Command failed with error 72 (InvalidOptions): 'The field 'expireAfterSeconds' is not a valid collection option. Options: { capped: false, expireAfterSeconds: 86400, timeseries: { timeField: "timestamp", metaField: "metadata", granularity: "minutes" } }' on server %mongohostport%. The full response is {"ok": 0.0, "errmsg": "The field 'expireAfterSeconds' is not a valid collection option. Options: { capped: false, expireAfterSeconds: 86400, timeseries: { timeField: \"timestamp\", metaField: \"metadata\", granularity: \"minutes\" } }", "code": 72, "codeName": "InvalidOptions"} +com.mongodb.MongoCommandException: Command failed with error 72 (InvalidOptions): 'The field 'expireAfterSeconds' is not a valid collection option. Options: { capped: false, expireAfterSeconds: 315360000, timeseries: { timeField: "timestamp", metaField: "metadata", granularity: "minutes" } }' on server %mongohostport%. The full response is {"ok": 0.0, "errmsg": "The field 'expireAfterSeconds' is not a valid collection option. Options: { capped: false, expireAfterSeconds: 315360000, timeseries: { timeField: \"timestamp\", metaField: \"metadata\", granularity: \"minutes\" } }", "code": 72, "codeName": "InvalidOptions"} { "acknowledged": true, "insertedId": } -{ "timestamp": {"$date": {"$numberLong": "1621296000000"}} } \ No newline at end of file +{ "timestamp": {"$date": {"$numberLong": "1662681600000"}} } \ No newline at end of file diff --git a/packages/java-shell/src/test/resources/db/createCollectionWithTimeseries.expected.txt b/packages/java-shell/src/test/resources/db/createCollectionWithTimeseries.expected.txt index fe7765b7d4..ed233a1175 100644 --- a/packages/java-shell/src/test/resources/db/createCollectionWithTimeseries.expected.txt +++ b/packages/java-shell/src/test/resources/db/createCollectionWithTimeseries.expected.txt @@ -1,2 +1,2 @@ { "acknowledged": true, "insertedId": } -{ "timestamp": {"$date": {"$numberLong": "1621296000000"}} } \ No newline at end of file +{ "timestamp": {"$date": {"$numberLong": "1662681600000"}} } \ No newline at end of file diff --git a/packages/java-shell/src/test/resources/db/createCollectionWithTimeseries.js b/packages/java-shell/src/test/resources/db/createCollectionWithTimeseries.js index 12494c426e..35e92db17d 100644 --- a/packages/java-shell/src/test/resources/db/createCollectionWithTimeseries.js +++ b/packages/java-shell/src/test/resources/db/createCollectionWithTimeseries.js @@ -7,18 +7,18 @@ db.createCollection('coll', { metaField: "metadata", granularity: "minutes" }, - expireAfterSeconds: 86400 + expireAfterSeconds: 60 * 60 * 24 * 365 * 10 }) // command db.coll.insertOne( { "metadata": { "sensorId": 5578, "type": "temperature" }, - "timestamp": ISODate("2021-05-18T00:00:00.000Z"), + "timestamp": new ISODate("2022-09-09T00:00:00.000Z"), "temp": 12 }); // command db.coll.findOne({ - "timestamp": ISODate("2021-05-18T00:00:00.000Z") + "timestamp": new ISODate("2022-09-09T00:00:00.000Z") }, {_id: 0, timestamp: 1}); // clear db.coll.drop(); \ No newline at end of file