0

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, i.e. it has to be set as False.

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

Community
  • 1
  • 1
Somesh
  • 1,235
  • 2
  • 13
  • 29
  • as unique you mean index on the title field being unique? Better to fix description on your question and title if that is the case – fgakk Oct 01 '13 at 05:45
  • I have define my task datamodel something like this: title = mongoengine.StringField(max_length=128, unique=True) it's not about the indexes. – Somesh Oct 01 '13 at 06:30
  • My bad just realized 'mongoengine' tag – fgakk Oct 01 '13 at 07:30

1 Answers1

1

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.

tbicr
  • 24,790
  • 12
  • 81
  • 106