blob: 3414f3b52940af5ae72d9bd9c1feccb44ad90127 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
/**
* Tests that listCollections includes time-series collections and their options when filtering on
* name.
*
* @tags: [
* assumes_no_implicit_collection_creation_after_drop,
* does_not_support_transactions,
* requires_getmore,
* ]
*/
(function() {
'use strict';
const timeFieldName = 'time';
const coll = db.timeseries_list_collections_filter_name;
coll.drop();
assert.commandWorked(db.createCollection(coll.getName(), {timeseries: {timeField: timeFieldName}}));
const collections =
assert.commandWorked(db.runCommand({listCollections: 1, filter: {name: coll.getName()}}))
.cursor.firstBatch;
assert.eq(collections, [{
name: coll.getName(),
type: 'timeseries',
options: {
timeseries:
{timeField: timeFieldName, granularity: 'seconds', bucketMaxSpanSeconds: 3600}
},
info: {readOnly: false},
}]);
})();
|