const mongo = new ShardingTest({shards: 2, rs: {nodes: 3}});
const dbName = 'testDB';
const tsViewName = 'tsView';
const viewNss = `${dbName}.${tsViewName}`;
assert.commandWorked(mongo.s0.adminCommand({enableSharding: dbName}));
const db = mongo.s0.getDB(dbName);
assert.commandWorked(
db.createCollection(tsViewName, {timeseries: {timeField: "time", metaField: "meta"}}));
assert.commandWorked(mongo.s0.adminCommand({
shardCollection: viewNss,
key: {"meta": 1},
}));
assert.commandWorked(mongo.s0.adminCommand(
{refineCollectionShardKey: viewNss, key: {"randField": 1}, collectionUUID: UUID()}));