Skip to content

Instantly share code, notes, and snippets.

@aniruddha27
Created September 9, 2020 14:37
Show Gist options
  • Save aniruddha27/eebcc7ff1fd53c91cb3f05db35772702 to your computer and use it in GitHub Desktop.
Save aniruddha27/eebcc7ff1fd53c91cb3f05db35772702 to your computer and use it in GitHub Desktop.
# Create unique Compound Index
db.restaurants.create_index([('cuisine',pymongo.ASCENDING),
('borough',pymongo.ASCENDING)],
name='cuisine_borough',
unique=True)
pprint(db.neighborhoods.index_information())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment