简体   繁体   中英

update a property of field in a mongodb collection

I have a collection Task in which I have a field title as unique = True, but due to latest requirement this unique = True has to be removed, ie it has to be set as False.

Is there a way to do this ? Ofcourse I don't want to drop my collection.

You must update your model code and remove index from collection. See specification: http://docs.mongodb.org/manual/reference/method/db.collection.dropIndex/ . Do not forgot make backup.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM