0

How do I create index on items.id field in this mongokit schema?
I tried to creating index on items.id, but it's throwing ValueError: Error in indexes: can't find items.id in structure.

structure = {
   'items': [{
        'id': int,
    }]
}

indexes = [{   
    'fields': ['items.id'],
    }]
kefeizhou
  • 6,234
  • 10
  • 42
  • 55

1 Answers1

1

Currently, MongoKit's index validation doesn't support validation on indexed array. For this usecase, you have disabled indexes validation:

indexes = [
  {'fields': ['items.id'], 'check':False}
]

you can vote on this issue here : http://github.com/namlook/mongokit/issues#issue/42

Namlook
  • 181
  • 11