-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: Durran Jordan <durran@gmail.com>
- Loading branch information
1 parent
fcff6fe
commit 325c4bc
Showing
8 changed files
with
166 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
test/spec/unified-test-format/valid-pass/collectionData-createOptions.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{ | ||
"description": "collectionData-createOptions", | ||
"schemaVersion": "1.9", | ||
"runOnRequirements": [ | ||
{ | ||
"minServerVersion": "3.6", | ||
"serverless": "forbid" | ||
} | ||
], | ||
"createEntities": [ | ||
{ | ||
"client": { | ||
"id": "client0" | ||
} | ||
}, | ||
{ | ||
"database": { | ||
"id": "database0", | ||
"client": "client0", | ||
"databaseName": "database0" | ||
} | ||
}, | ||
{ | ||
"collection": { | ||
"id": "collection0", | ||
"database": "database0", | ||
"collectionName": "coll0" | ||
} | ||
} | ||
], | ||
"initialData": [ | ||
{ | ||
"collectionName": "coll0", | ||
"databaseName": "database0", | ||
"createOptions": { | ||
"capped": true, | ||
"size": 4096 | ||
}, | ||
"documents": [ | ||
{ | ||
"_id": 1, | ||
"x": 11 | ||
} | ||
] | ||
} | ||
], | ||
"tests": [ | ||
{ | ||
"description": "collection is created with the correct options", | ||
"operations": [ | ||
{ | ||
"object": "collection0", | ||
"name": "aggregate", | ||
"arguments": { | ||
"pipeline": [ | ||
{ | ||
"$collStats": { | ||
"storageStats": {} | ||
} | ||
}, | ||
{ | ||
"$project": { | ||
"capped": "$storageStats.capped", | ||
"maxSize": "$storageStats.maxSize" | ||
} | ||
} | ||
] | ||
}, | ||
"expectResult": [ | ||
{ | ||
"capped": true, | ||
"maxSize": 4096 | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
42 changes: 42 additions & 0 deletions
42
test/spec/unified-test-format/valid-pass/collectionData-createOptions.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
description: collectionData-createOptions | ||
|
||
schemaVersion: "1.9" | ||
|
||
runOnRequirements: | ||
- minServerVersion: "3.6" | ||
# Capped collections cannot be created on serverless instances. | ||
serverless: forbid | ||
|
||
createEntities: | ||
- client: | ||
id: &client0 client0 | ||
- database: | ||
id: &database0 database0 | ||
client: *client0 | ||
databaseName: &database0Name database0 | ||
- collection: | ||
id: &collection0 collection0 | ||
database: *database0 | ||
collectionName: &collection0Name coll0 | ||
|
||
initialData: | ||
- collectionName: *collection0Name | ||
databaseName: *database0Name | ||
createOptions: | ||
capped: true | ||
# With MMAPv1, the size field cannot be less than 4096. | ||
size: &cappedSize 4096 | ||
documents: | ||
- { _id: 1, x: 11 } | ||
|
||
tests: | ||
- description: collection is created with the correct options | ||
operations: | ||
- object: *collection0 | ||
name: aggregate | ||
arguments: | ||
pipeline: | ||
- $collStats: { storageStats: {} } | ||
- $project: { capped: '$storageStats.capped', maxSize: '$storageStats.maxSize'} | ||
expectResult: | ||
- { capped: true, maxSize: *cappedSize } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters