Allow sparse compound indexes

This commit is contained in:
George Macon
2015-09-16 15:27:57 -04:00
committed by George Macon
parent 31d7f70e27
commit 00221e3410
3 changed files with 15 additions and 4 deletions

View File

@@ -839,10 +839,6 @@ class BaseDocument(object):
if index_list:
spec['fields'] = index_list
if spec.get('sparse', False) and len(spec['fields']) > 1:
raise ValueError(
'Sparse indexes can only have one field in them. '
'See https://jira.mongodb.org/browse/SERVER-2193')
return spec