-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-3227 Clustered Indexes for all Collections #971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5ddbf62
initial commit
juliusgeo 64f282f
fix docs
juliusgeo 42e4bdd
make _collectionOperation_listIndexes return a list
juliusgeo 86a5fc7
make encrypted_fields and clustered_index part of kwargs
juliusgeo eb01e37
remove workaround and fix typo
juliusgeo 35e18c3
fix an issue in spec test runner
juliusgeo 55d086c
fix TestSpec errors
juliusgeo b7cc68c
remove duplication in docs
juliusgeo c230707
fix merge conflict
juliusgeo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,177 @@ | ||
{ | ||
"description": "clustered-indexes", | ||
"schemaVersion": "1.4", | ||
"runOnRequirements": [ | ||
{ | ||
"minServerVersion": "5.3", | ||
"serverless": "forbid" | ||
} | ||
], | ||
"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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given this description of kwargs, I wonder if it would be more consistent to not add an explicit "clustered_index" parameter and instead document clusteredIndex as an acceptable kwarg below. If so, we probably do the same for encrypted_fields.
We would make the same change to Collection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM!