8👍
✅
Thanks to skot in #mongodb!!
One solution is:
[...].ensureIndex({"actions.time":1})
for creating an index on the time field within the actions list.
12👍
Example for pymongo:
import pymongo
mongo = pymongo.Connection('localhost')
collection = mongo['database']['hosts']
collection.ensure_index('host_name', unique=True)
- [Django]-Sublime text 3 Anaconda goto definition not working with Django
- [Django]-Best way to incorporate external django app into a project and safely make local changes
Source:stackexchange.com