Replies: 1 comment
-
|
Hey @sonpxp, you can use the import pymongo
mongo_client['collection'].create_index(['property_name': pymongo.ASCENDING)], unique=True)If you need more than one index you can simply add more properties to the array as described here. I hope I've been able to help? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
how to create unique index in mongodb with FastAPI
Beta Was this translation helpful? Give feedback.
All reactions