Created
September 9, 2020 14:38
-
-
Save aniruddha27/3292c4d75a74fd0c48dfa04f06b32a02 to your computer and use it in GitHub Desktop.
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
# Create multikey index | |
db.restaurants.create_index([('grades.grade', pymongo.ASCENDING), | |
('grades.score', pymongo.ASCENDING)], | |
name='grade_score', unique=True) | |
# List indexes | |
pprint(db.restaurants.index_information()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment