additional fixes to support Mongo3.4

This commit is contained in:
Bastien Gérard
2019-02-24 22:34:17 +01:00
parent dca837b843
commit 7247b9b68e
5 changed files with 15 additions and 9 deletions

View File

@@ -808,7 +808,7 @@ class Document(six.with_metaclass(TopLevelDocumentMetaclass, BaseDocument)):
db.drop_collection(col_name)
@classmethod
def create_index(cls, keys, background=False, **kwargs):
def _create_index(cls, keys, background=False, **kwargs):
"""Creates the given indexes if required.
:param keys: a single index key or a list of index keys (to
@@ -851,7 +851,7 @@ class Document(six.with_metaclass(TopLevelDocumentMetaclass, BaseDocument)):
warnings.warn(msg, DeprecationWarning)
elif not IS_PYMONGO_3:
kwargs.update({'drop_dups': drop_dups})
return cls.create_index(key_or_list, background=background, **kwargs)
return cls._create_index(key_or_list, background=background, **kwargs)
@classmethod
def ensure_indexes(cls):

View File

@@ -1,5 +1,5 @@
"""
Helper functions, constants, and types to aid with MongoDB v3.x support
Helper functions, constants, and types to aid with MongoDB version support
"""
from mongoengine.connection import get_connection