Debian Codegraph @

testdata/unified-test-format/valid-pass/collectionData-createOptions.yml

raw
1 description: collectionData-createOptions
2 schemaVersion: "1.9"
3 runOnRequirements:
4 - minServerVersion: "3.6"
5 # Capped collections cannot be created on serverless instances.
6 serverless: forbid
7 createEntities:
8 - client:
9 id: &client0 client0
10 - database:
11 id: &database0 database0
12 client: *client0
13 databaseName: &database0Name database0
14 - collection:
15 id: &collection0 collection0
16 database: *database0
17 collectionName: &collection0Name coll0
18 initialData:
19 - collectionName: *collection0Name
20 databaseName: *database0Name
21 createOptions:
22 capped: true
23 # With MMAPv1, the size field cannot be less than 4096.
24 size: &cappedSize 4096
25 documents:
26 - { _id: 1, x: 11 }
27 tests:
28 - description: collection is created with the correct options
29 operations:
30 - object: *collection0
31 name: aggregate
32 arguments:
33 pipeline:
34 - $collStats: { storageStats: {} }
35 - $project: { capped: '$storageStats.capped', maxSize: '$storageStats.maxSize'}
36 expectResult:
37 - { capped: true, maxSize: *cappedSize }