-
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
- Loading branch information
Showing
4 changed files
with
285 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,176 @@ | ||
{ | ||
"description": "clustered-indexes", | ||
"schemaVersion": "1.0", | ||
"runOnRequirements": [ | ||
{ | ||
"minServerVersion": "5.3" | ||
} | ||
], | ||
"createEntities": [ | ||
{ | ||
"client": { | ||
"id": "client0" | ||
} | ||
}, | ||
{ | ||
"database": { | ||
"id": "database0", | ||
"client": "client0", | ||
"databaseName": "ts-tests" | ||
} | ||
}, | ||
{ | ||
"collection": { | ||
"id": "collection0", | ||
"database": "database0", | ||
"collectionName": "test" | ||
} | ||
} | ||
], | ||
"initialData": [ | ||
{ | ||
"collectionName": "test", | ||
"databaseName": "ts-tests", | ||
"documents": [] | ||
} | ||
], | ||
"tests": [ | ||
{ | ||
"description": "createCollection with clusteredIndex", | ||
"operations": [ | ||
{ | ||
"name": "dropCollection", | ||
"object": "database0", | ||
"arguments": { | ||
"collection": "test" | ||
} | ||
}, | ||
{ | ||
"name": "createCollection", | ||
"object": "database0", | ||
"arguments": { | ||
"collection": "test", | ||
"clusteredIndex": { | ||
"key": { | ||
"_id": 1 | ||
}, | ||
"unique": true, | ||
"name": "test index" | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "assertCollectionExists", | ||
"object": "testRunner", | ||
"arguments": { | ||
"databaseName": "ts-tests", | ||
"collectionName": "test" | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
"description": "listCollections includes clusteredIndex", | ||
"operations": [ | ||
{ | ||
"name": "dropCollection", | ||
"object": "database0", | ||
"arguments": { | ||
"collection": "test" | ||
} | ||
}, | ||
{ | ||
"name": "createCollection", | ||
"object": "database0", | ||
"arguments": { | ||
"collection": "test", | ||
"clusteredIndex": { | ||
"key": { | ||
"_id": 1 | ||
}, | ||
"unique": true, | ||
"name": "test index" | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "listCollections", | ||
"object": "database0", | ||
"arguments": { | ||
"filter": { | ||
"name": { | ||
"$eq": "test" | ||
} | ||
} | ||
}, | ||
"expectResult": [ | ||
{ | ||
"name": "test", | ||
"options": { | ||
"clusteredIndex": { | ||
"key": { | ||
"_id": 1 | ||
}, | ||
"unique": true, | ||
"name": "test index", | ||
"v": { | ||
"$$type": [ | ||
"int", | ||
"long" | ||
] | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"description": "listIndexes returns the index", | ||
"operations": [ | ||
{ | ||
"name": "dropCollection", | ||
"object": "database0", | ||
"arguments": { | ||
"collection": "test" | ||
} | ||
}, | ||
{ | ||
"name": "createCollection", | ||
"object": "database0", | ||
"arguments": { | ||
"collection": "test", | ||
"clusteredIndex": { | ||
"key": { | ||
"_id": 1 | ||
}, | ||
"unique": true, | ||
"name": "test index" | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "listIndexes", | ||
"object": "collection0", | ||
"expectResult": [ | ||
{ | ||
"key": { | ||
"_id": 1 | ||
}, | ||
"name": "test index", | ||
"clustered": true, | ||
"unique": true, | ||
"v": { | ||
"$$type": [ | ||
"int", | ||
"long" | ||
] | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
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,94 @@ | ||
description: "clustered-indexes" | ||
|
||
schemaVersion: "1.0" | ||
|
||
runOnRequirements: | ||
- minServerVersion: "5.3" | ||
|
||
createEntities: | ||
- client: | ||
id: &client0 client0 | ||
- database: | ||
id: &database0 database0 | ||
client: *client0 | ||
databaseName: &database0Name ts-tests | ||
- collection: | ||
id: &collection0 collection0 | ||
database: *database0 | ||
collectionName: &collection0Name test | ||
|
||
initialData: | ||
- collectionName: *collection0Name | ||
databaseName: *database0Name | ||
documents: [] | ||
|
||
tests: | ||
- description: "createCollection with clusteredIndex" | ||
operations: | ||
- name: dropCollection | ||
object: *database0 | ||
arguments: | ||
collection: *collection0Name | ||
- name: createCollection | ||
object: *database0 | ||
arguments: | ||
collection: *collection0Name | ||
clusteredIndex: | ||
key: { _id: 1 } | ||
unique: true | ||
name: &index0Name "test index" | ||
- name: assertCollectionExists | ||
object: testRunner | ||
arguments: | ||
databaseName: *database0Name | ||
collectionName: *collection0Name | ||
|
||
- description: "listCollections includes clusteredIndex" | ||
operations: | ||
- name: dropCollection | ||
object: *database0 | ||
arguments: | ||
collection: *collection0Name | ||
- name: createCollection | ||
object: *database0 | ||
arguments: | ||
collection: *collection0Name | ||
clusteredIndex: | ||
key: { _id: 1 } | ||
unique: true | ||
name: &index0Name "test index" | ||
- name: listCollections | ||
object: *database0 | ||
arguments: | ||
filter: { name: { $eq: *collection0Name } } | ||
expectResult: | ||
- name: *collection0Name | ||
options: | ||
clusteredIndex: | ||
key: { _id: 1 } | ||
unique: true | ||
name: *index0Name | ||
v: { $$type: [ int, long ] } | ||
|
||
- description: "listIndexes returns the index" | ||
operations: | ||
- name: dropCollection | ||
object: *database0 | ||
arguments: | ||
collection: *collection0Name | ||
- name: createCollection | ||
object: *database0 | ||
arguments: | ||
collection: *collection0Name | ||
clusteredIndex: | ||
key: { _id: 1 } | ||
unique: true | ||
name: *index0Name | ||
- name: listIndexes | ||
object: *collection0 | ||
expectResult: | ||
- key: { _id: 1 } | ||
name: *index0Name | ||
clustered: true | ||
unique: true | ||
v: { $$type: [ int, long ] } |