@@ -851,30 +851,21 @@ def create_index(cls, keys, background=False, **kwargs):
851
851
index_spec = cls ._build_index_spec (keys )
852
852
index_spec = index_spec .copy ()
853
853
fields = index_spec .pop ("fields" )
854
- drop_dups = kwargs .get ("drop_dups" , False )
855
- if drop_dups :
856
- msg = "drop_dups is deprecated and is removed when using PyMongo 3+."
857
- warnings .warn (msg , DeprecationWarning )
858
854
index_spec ["background" ] = background
859
855
index_spec .update (kwargs )
860
856
861
857
return cls ._get_collection ().create_index (fields , ** index_spec )
862
858
863
859
@classmethod
864
- def ensure_index (cls , key_or_list , drop_dups = False , background = False , ** kwargs ):
860
+ def ensure_index (cls , key_or_list , background = False , ** kwargs ):
865
861
"""Ensure that the given indexes are in place. Deprecated in favour
866
862
of create_index.
867
863
868
864
:param key_or_list: a single index key or a list of index keys (to
869
865
construct a multi-field index); keys may be prefixed with a **+**
870
866
or a **-** to determine the index ordering
871
867
:param background: Allows index creation in the background
872
- :param drop_dups: Was removed/ignored with MongoDB >2.7.5. The value
873
- will be removed if PyMongo3+ is used
874
868
"""
875
- if drop_dups :
876
- msg = "drop_dups is deprecated and is removed when using PyMongo 3+."
877
- warnings .warn (msg , DeprecationWarning )
878
869
return cls .create_index (key_or_list , background = background , ** kwargs )
879
870
880
871
@classmethod
@@ -887,12 +878,8 @@ def ensure_indexes(cls):
887
878
`auto_create_index` to False in the documents meta data
888
879
"""
889
880
background = cls ._meta .get ("index_background" , False )
890
- drop_dups = cls ._meta .get ("index_drop_dups" , False )
891
881
index_opts = cls ._meta .get ("index_opts" ) or {}
892
882
index_cls = cls ._meta .get ("index_cls" , True )
893
- if drop_dups :
894
- msg = "drop_dups is deprecated and is removed when using PyMongo 3+."
895
- warnings .warn (msg , DeprecationWarning )
896
883
897
884
collection = cls ._get_collection ()
898
885
# 746: when connection is via mongos, the read preference is not necessarily an indication that
0 commit comments