Add db index for molecule_hash
@@ -54,7 +54,9 @@ class Molecule(db.DynamicDocument):
meta = {
'collection': 'molecules',
'indexes': [
- {'fields': ('molecule_hash', 'molecular_formula'),
+ {'fields': ('molecule_hash',), 'unique': True},
+ {
+ 'fields': ('molecule_hash', 'molecular_formula'),
'unique': False
} # TODO: what is unique?
]
@@ -269,7 +271,8 @@ class TaskQueue(db.DynamicDocument):
'status',
'manager',
# {'fields': ("status", "tag", "hash_index"), 'unique': False}
- {'fields': ("base_result",), 'unique': True} # new
+ {'fields': ('base_result',), 'unique': True}, # new
+ # {'fields': ('hash_index',), 'unique': True}
]
# 'indexes': [
@@ -303,7 +306,8 @@ class ServiceQueue(db.DynamicDocument):
meta = {
'indexes': [
'status',
- {'fields': ("status", "tag", "hash_index"), 'unique': False}
+ {'fields': ("status", "tag", "hash_index"), 'unique': False},
+ # {'fields': ('hash_index',), 'unique': True}
]
}
