diff options
author | Sviatlana Zuiko <sviatlana.zuiko@mongodb.com> | 2022-06-30 18:11:13 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-06-30 20:06:51 +0000 |
commit | 831c5c4617312f901dfa3d70838a591365e12825 (patch) | |
tree | a3bde1b1bd91f8a3b0732e38c3f5fac7c013c9c8 /jstests | |
parent | b6f28cafe782fcaa03320d8b9660510ba2fbc892 (diff) | |
download | mongo-831c5c4617312f901dfa3d70838a591365e12825.tar.gz |
Revert "SERVER-66976 Enabled validation for time-series collections"
This reverts commit 37d3534f0d6212cf3e89785152a1fdaa180cceeb.
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/noPassthroughWithMongod/validate_timeseries.js | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/jstests/noPassthroughWithMongod/validate_timeseries.js b/jstests/noPassthroughWithMongod/validate_timeseries.js deleted file mode 100644 index 3d08ec0a8d3..00000000000 --- a/jstests/noPassthroughWithMongod/validate_timeseries.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Tests that calling the validate command on a time-series collection is allowed, while ensuring - * that calling validate on non-time-series views is still prohibited, even if a collection with the - * bucket namespace of that view exists. - * - * @tags: [ - * featureFlagExtendValidateCommand - * ] - */ - -(function() { -"use strict"; - -db.validate_timeseries.drop(); -db.system.buckets.validate_timeseries.drop(); -db.viewSource.drop(); -db.view.drop(); -db.system.buckets.view.drop(); - -assert.commandWorked(db.createCollection( - "validate_timeseries", - {timeseries: {timeField: "timestamp", metaField: "metadata", granularity: "hours"}})); - -const coll = db.validate_timeseries; -const bucketColl = db.system.buckets.validate_timeseries; -const weather_data = [ - { - "metadata": {"sensorId": 5578, "type": "temperature"}, - "timestamp": ISODate("2021-05-18T00:00:00.000Z"), - "temp": 12 - }, - { - "metadata": {"sensorId": 5578, "type": "temperature"}, - "timestamp": ISODate("2021-05-18T04:00:00.000Z"), - "temp": 11 - }, -]; - -assert.commandWorked(coll.insertMany(weather_data)); - -// Tests that the validate command can be run on a time-series collection. - -let res = assert.commandWorked(coll.validate()); -assert(res.valid, tojson(res)); - -res = assert.commandWorked(bucketColl.validate()); -assert(res.valid, tojson(res)); - -// Tests that the validate command doesn't run on a view without a bucket collection. -assert.commandWorked(db.createCollection("viewSource")); - -assert.commandWorked(db.createView("view", "viewSource", [{$project: {"Name": "$temp"}}])); - -const viewSource = db.viewSource; -const view = db.view; - -res = assert.commandWorked(viewSource.validate()); -assert(res.valid, tojson(res)); - -assert.commandFailedWithCode(view.validate(), ErrorCodes.CommandNotSupportedOnView); - -// Tests that the validate command doesn't run on a view with a non-time-series bucket collection. -assert.commandWorked(db.createCollection("system.buckets.view")); - -assert.commandFailedWithCode(view.validate(), ErrorCodes.CommandNotSupportedOnView); - -// -})(); |