
    &g                    8   S r SSKJr  SSKrSSKJrJrJrJrJ	r	J
r
JrJr  SSKJr  SSKJr  SSKJr  SSKJrJr  SS	KJr  SS
KJrJrJr  SSKJrJrJr  SSK J!r!  \(       a  SSKJ"r"J#r#  \\
\\$\\$\\%\$\\$\4   4   4   4      \\$\4   4   r&\\$\&4   r' " S S\$\RP                  5      r) " S S\\   5      r* " S S5      r+ " S S\+5      r, " S S\+5      r- " S S\\   5      r. " S S5      r/ " S S\/5      r0 " S S\/5      r1 " S  S!5      r2 " S" S#5      r3g)$z~Operation class definitions.

.. seealso:: This module is compatible with both the synchronous and asynchronous PyMongo APIs.
    )annotationsN)TYPE_CHECKINGAnyGenericMappingOptionalSequenceTupleUnion)RawBSONDocument)helpers_shared)validate_collation_or_none)validate_is_mappingvalidate_list)InvalidOperation)_gen_index_name_index_document_index_list)_CollationIn_DocumentType	_Pipeline)validate_boolean)_AgnosticBulk_AgnosticClientBulkc                      \ rS rSrSrSrSrSrSrSr	Sr
S	rS
rSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSrSr Sr!g )!_Op5   abortTransaction	aggregate	bulkWritecommitTransactioncountcreatecreateIndexescreateSearchIndexesdeletedistinctdropdropDatabasedropIndexesdropSearchIndexesendSessionsfindAndModifyfindinsertlistCollectionslistIndexeslistSearchIndexeslistDatabasesupdateupdateIndexupdateSearchIndexrenamegetMorekillCursorstestOperation N)"__name__
__module____qualname____firstlineno__ABORT	AGGREGATE
BULK_WRITECOMMITCOUNTCREATECREATE_INDEXESCREATE_SEARCH_INDEXESDELETEDISTINCTDROPDROP_DATABASEDROP_INDEXESDROP_SEARCH_INDEXESEND_SESSIONSFIND_AND_MODIFYFINDINSERTLIST_COLLECTIONSLIST_INDEXESLIST_SEARCH_INDEXLIST_DATABASESUPDATEUPDATE_INDEXUPDATE_SEARCH_INDEXRENAMEGETMOREKILL_CURSORSTEST__static_attributes__r;       WC:\Suresh\moveshuttle\MDcreated\moveengine\venv\Lib\site-packages\pymongo/operations.pyr   r   5   s    EIJ FEF$N1FHD"M L- L%ODF( L+$NF L-FG LDr^   r   c                  \    \ rS rSrSrSrSSS jjrSS jrSS jrSS jr	SS	 jr
SS
 jrSrg)	InsertOneU   z#Represents an insert_one operation._doc
_namespaceNc                    Xl         X l        g)a6  Create an InsertOne instance.

For use with :meth:`~pymongo.asynchronous.collection.AsyncCollection.bulk_write`, :meth:`~pymongo.collection.Collection.bulk_write`,
:meth:`~pymongo.asynchronous.mongo_client.AsyncMongoClient.bulk_write` and :meth:`~pymongo.mongo_client.MongoClient.bulk_write`.

:param document: The document to insert. If the document is missing an
    _id field one will be added.
:param namespace: (optional) The namespace in which to insert a document.

.. versionchanged:: 4.9
   Added the `namespace` option to support `MongoClient.bulk_write`.
Nrc   )selfdocument	namespaces      r_   __init__InsertOne.__init__]   s     	#r^   c                :    UR                  U R                  5        g)>Add this operation to the _AsyncBulk/_Bulk instance `bulkobj`.N)
add_insertrd   rg   bulkobjs     r_   _add_to_bulkInsertOne._add_to_bulkm   s    499%r^   c                    U R                   (       d  [        S5      eUR                  U R                   U R                  5        g)JAdd this operation to the _AsyncClientBulk/_ClientBulk instance `bulkobj`.SMongoClient.bulk_write requires a namespace to be provided for each write operationN)re   r   rn   rd   ro   s     r_   _add_to_client_bulkInsertOne._add_to_client_bulkq   s7    "e  	OOII	
r^   c                    U R                   (       a5  U R                  R                   SU R                  < SU R                   < S3$ U R                  R                   SU R                  < S3$ )N(, ))re   	__class__r<   rd   rg   s    r_   __repr__InsertOne.__repr__|   sY    ??nn--.a		}Bt>QQRSS..))*!DII=::r^   c                    [        U5      [        U 5      :X  a9  UR                  U R                  :H  =(       a    UR                  U R                  :H  $ [        $ N)typerd   re   NotImplementedrg   others     r_   __eq__InsertOne.__eq__   s?    ;$t*$::*Ru/?/?4??/RRr^   c                    X:X  + $ r   r;   r   s     r_   __ne__InsertOne.__ne__         r^   r   )rh   r   ri   Optional[str]returnNonerp   r   r   r   rp   r   r   r   r   strr   r   r   bool)r<   r=   r>   r?   __doc__	__slots__rj   rq   rv   r~   r   r   r]   r;   r^   r_   ra   ra   U   s*    -I
$ &	
;

!r^   ra   c                  `    \ rS rSrSrSr   S
         SS jjrSS jrSS jrSS jr	S	r
g)	_DeleteOp   z)Private base class for delete operations.)_filter
_collation_hintre   Nc                    Ub  [        SU5        Ub1  [        U[        5      (       d  [        R                  " U5      U l        OX0l        Xl        X l        X@l        g )Nfilter)	r   
isinstancer   r   r   r   r   r   re   )rg   r   	collationhintri   s        r_   rj   _DeleteOp.__init__   sM     &1JtS$9$9;I;Y;YZ^;_DJJ##r^   c                    [        U5      [        U 5      :X  a]  UR                  UR                  UR                  UR                  4U R                  U R                  U R                  U R                  4:H  $ [
        $ r   )r   r   r   r   re   r   r   s     r_   r   _DeleteOp.__eq__   sl    ;$t*$    	 

	
 
 r^   c                    X:X  + $ r   r;   r   s     r_   r   _DeleteOp.__ne__   r   r^   c                L   U R                   (       aQ  SR                  U R                  R                  U R                  U R
                  U R                  U R                   5      $ U R                  R                   SU R                  < SU R
                  < SU R                  < S3$ )Nz{}({!r}, {!r}, {!r}, {!r})ry   rz   r{   )re   formatr|   r<   r   r   r   r}   s    r_   r~   _DeleteOp.__repr__   s    ??/66''

  ..))*!DLL+;2doo=PPRSWS]S]R``abbr^   )r   r   r   re   NNN
r   Mapping[str, Any]r   Optional[_CollationIn]r   Optional[_IndexKeyHint]ri   r   r   r   r   r   r<   r=   r>   r?   r   r   rj   r   r   r~   r]   r;   r^   r_   r   r      s\    3I -1(,#'$!$ *$ &	$
 !$ 
$$!	cr^   r   c                  d   ^  \ rS rSrSrSr   S         SU 4S jjjrS	S jrS
S jrSr	U =r
$ )	DeleteOne   z"Represents a delete_one operation.r;   c                &   > [         TU ]  XX45        g)a5  Create a DeleteOne instance.

For use with :meth:`~pymongo.asynchronous.collection.AsyncCollection.bulk_write`, :meth:`~pymongo.collection.Collection.bulk_write`,
:meth:`~pymongo.asynchronous.mongo_client.AsyncMongoClient.bulk_write` and :meth:`~pymongo.mongo_client.MongoClient.bulk_write`.

:param filter: A query that matches the document to delete.
:param collation: An instance of
    :class:`~pymongo.collation.Collation`.
:param hint: An index to use to support the query
    predicate specified either by its string name, or in the same
    format as passed to
    :meth:`~pymongo.asynchronous.collection.AsyncCollection.create_index` or :meth:`~pymongo.collection.Collection.create_index` (e.g.
    ``[('field', ASCENDING)]``). This option is only supported on
    MongoDB 4.4 and above.
:param namespace: (optional) The namespace in which to delete a document.

.. versionchanged:: 4.9
   Added the `namespace` option to support `MongoClient.bulk_write`.
.. versionchanged:: 3.11
   Added the ``hint`` option.
.. versionchanged:: 3.5
   Added the `collation` option.
Nsuperrj   rg   r   r   r   ri   r|   s        r_   rj   DeleteOne.__init__       < 	D<r^   c                v    UR                  U R                  S[        U R                  5      U R                  S9  g)rm      r   r   N
add_deleter   r   r   r   ro   s     r_   rq   DeleteOne._add_to_bulk   2    LL0A	 	 	
r^   c                    U R                   (       d  [        S5      eUR                  U R                   U R                  S[	        U R
                  5      U R                  S9  g)rt   ru   Fmultir   r   Nre   r   r   r   r   r   r   ro   s     r_   rv   DeleteOne._add_to_client_bulk   sR    "e  	OOLL0A 	 	
r^   r   r   r   r   r<   r=   r>   r?   r   r   rj   rq   rv   r]   __classcell__r|   s   @r_   r   r      s`    ,I
 -1(,#'=!= *= &	=
 != 
= =@

 
r^   r   c                  d   ^  \ rS rSrSrSr   S         SU 4S jjjrS	S jrS
S jrSr	U =r
$ )
DeleteManyi  z#Represents a delete_many operation.r;   c                &   > [         TU ]  XX45        g)a6  Create a DeleteMany instance.

For use with :meth:`~pymongo.asynchronous.collection.AsyncCollection.bulk_write`, :meth:`~pymongo.collection.Collection.bulk_write`,
:meth:`~pymongo.asynchronous.mongo_client.AsyncMongoClient.bulk_write` and :meth:`~pymongo.mongo_client.MongoClient.bulk_write`.

:param filter: A query that matches the documents to delete.
:param collation: An instance of
    :class:`~pymongo.collation.Collation`.
:param hint: An index to use to support the query
    predicate specified either by its string name, or in the same
    format as passed to
    :meth:`~pymongo.asynchronous.collection.AsyncCollection.create_index` or :meth:`~pymongo.collection.Collection.create_index` (e.g.
    ``[('field', ASCENDING)]``). This option is only supported on
    MongoDB 4.4 and above.
:param namespace: (optional) The namespace in which to delete documents.

.. versionchanged:: 4.9
   Added the `namespace` option to support `MongoClient.bulk_write`.
.. versionchanged:: 3.11
   Added the ``hint`` option.
.. versionchanged:: 3.5
   Added the `collation` option.
Nr   r   s        r_   rj   DeleteMany.__init__  r   r^   c                v    UR                  U R                  S[        U R                  5      U R                  S9  g)rm   r   r   Nr   ro   s     r_   rq   DeleteMany._add_to_bulk&  r   r^   c                    U R                   (       d  [        S5      eUR                  U R                   U R                  S[	        U R
                  5      U R                  S9  g)rt   ru   Tr   Nr   ro   s     r_   rv   DeleteMany._add_to_client_bulk/  sR    "e  	OOLL0A 	 	
r^   r   r   r   r   r   r   s   @r_   r   r     s`    -I
 -1(,#'=!= *= &	=
 != 
= =@

 
r^   r   c                      \ rS rSrSrSr     S               SS jjrSS jrSS jrSS jr	SS	 jr
SS
 jrSrg)
ReplaceOnei>  z#Represents a replace_one operation.)r   rd   _upsertr   r   re   _sortNc                    Ub  [        SU5        Ub  [        SU5        Ub1  [        U[        5      (       d  [        R
                  " U5      U l        OXPl        Xpl        Xl        X l	        X0l
        X@l        X`l        g)a  Create a ReplaceOne instance.

For use with :meth:`~pymongo.asynchronous.collection.AsyncCollection.bulk_write`, :meth:`~pymongo.collection.Collection.bulk_write`,
:meth:`~pymongo.asynchronous.mongo_client.AsyncMongoClient.bulk_write` and :meth:`~pymongo.mongo_client.MongoClient.bulk_write`.

:param filter: A query that matches the document to replace.
:param replacement: The new document.
:param upsert: If ``True``, perform an insert if no documents
    match the filter.
:param collation: An instance of
    :class:`~pymongo.collation.Collation`.
:param hint: An index to use to support the query
    predicate specified either by its string name, or in the same
    format as passed to
    :meth:`~pymongo.asynchronous.collection.AsyncCollection.create_index` or :meth:`~pymongo.collection.Collection.create_index` (e.g.
    ``[('field', ASCENDING)]``). This option is only supported on
    MongoDB 4.2 and above.
:param sort: Specify which document the operation updates if the query matches
    multiple documents. The first document matched by the sort order will be updated.
:param namespace: (optional) The namespace in which to replace a document.

.. versionchanged:: 4.10
    Added ``sort`` option.
.. versionchanged:: 4.9
   Added the `namespace` option to support `MongoClient.bulk_write`.
.. versionchanged:: 3.11
   Added the ``hint`` option.
.. versionchanged:: 3.5
   Added the ``collation`` option.
Nr   upsert)r   r   r   r   r   r   r   r   r   rd   r   r   re   )rg   r   replacementr   r   r   ri   sorts           r_   rj   ReplaceOne.__init__K  sm    P &1Xv.JtS$9$9;I;Y;YZ^;_DJJ
	##r^   c           	         UR                  U R                  U R                  U R                  [	        U R
                  5      U R                  U R                  S9  g)rm   r   r   r   N)add_replacer   rd   r   r   r   r   r   ro   s     r_   rq   ReplaceOne._add_to_bulk  sD    LLIILL0A 	 	
r^   c           
        U R                   (       d  [        S5      eUR                  U R                   U R                  U R                  U R
                  [        U R                  5      U R                  U R                  S9  g)rt   ru   r   N)
re   r   r   r   rd   r   r   r   r   r   ro   s     r_   rv   ReplaceOne._add_to_client_bulk  sd    "e  	OOLLIILL0A 	 	
r^   c                |   [        U5      [        U 5      :X  a  UR                  UR                  UR                  UR                  UR
                  UR                  UR                  4U R                  U R                  U R                  U R                  U R
                  U R                  U R                  4:H  $ [        $ r   )	r   r   rd   r   r   r   re   r   r   r   s     r_   r   ReplaceOne.__eq__  s    ;$t*$

     		



 " r^   c                    X:X  + $ r   r;   r   s     r_   r   ReplaceOne.__ne__  r   r^   c           
        U R                   (       ar  SR                  U R                  R                  U R                  U R
                  U R                  U R                  U R                  U R                   U R                  5      $ SR                  U R                  R                  U R                  U R
                  U R                  U R                  U R                  U R                  5      $ )N,{}({!r}, {!r}, {!r}, {!r}, {!r}, {!r}, {!r})z&{}({!r}, {!r}, {!r}, {!r}, {!r}, {!r}))
re   r   r|   r<   r   rd   r   r   r   r   r}   s    r_   r~   ReplaceOne.__repr__  s    ??AHH''		



	 	 8>>NN##LLIILLOOJJJJ
 	
r^   )r   rd   r   r   re   r   r   NNNNN)r   r   r   z%Union[_DocumentType, RawBSONDocument]r   Optional[bool]r   r   r   r   ri   r   r   Optional[Mapping[str, Any]]r   r   r   r   r   r   )r<   r=   r>   r?   r   r   rj   rq   rv   r   r   r~   r]   r;   r^   r_   r   r   >  s    -I "&,0(,#',06$!6$ ;6$ 	6$
 *6$ &6$ !6$ *6$ 
6$p	

 *!
r^   r   c                  d    \ rS rSrSrSr                S
S jrSS jrSS jrSS jr	Sr
g	)	_UpdateOpi  z)Private base class for update operations.)r   rd   r   r   _array_filtersr   re   r   c	                &   Ub  [        SU5        Ub  [        SU5        Ub  [        SU5        Ub1  [        U[        5      (       d  [
        R                  " U5      U l        OX`l        Xl        X l	        X0l
        X@l        XPl        Xpl        Xl        g )Nr   r   array_filters)r   r   r   r   r   r   r   r   r   rd   r   r   r   re   r   )	rg   r   docr   r   r   r   ri   r   s	            r_   rj   _UpdateOp.__init__  s     &1Xv.$/=9JtS$9$9;I;Y;YZ^;_DJJ	#+#
r^   c           	        [        U[        U 5      5      (       a  UR                  UR                  UR                  UR
                  UR                  UR                  UR                  UR                  4U R                  U R                  U R                  U R
                  U R                  U R                  U R                  U R                  4:H  $ [        $ r   )r   r   r   rd   r   r   r   r   re   r   r   r   s     r_   r   _UpdateOp.__eq__  s    eT$Z((

  $$  	 		##



	 & r^   c                    X:X  + $ r   r;   r   s     r_   r   _UpdateOp.__ne__  r   r^   c                   U R                   (       a}  SR                  U R                  R                  U R                  U R
                  U R                  U R                  U R                  U R                  U R                   U R                  5	      $ SR                  U R                  R                  U R                  U R
                  U R                  U R                  U R                  U R                  U R                  5      $ )Nz2{}({!r}, {!r}, {!r}, {!r}, {!r}, {!r}, {!r}, {!r})r   )re   r   r|   r<   r   rd   r   r   r   r   r   r}   s    r_   r~   _UpdateOp.__repr__  s    ??GNN''		##




 
 >DDNN##LLIILLOOJJJJ	
 		
r^   )r   r   rd   r   r   re   r   r   N)r   r   r   #Union[Mapping[str, Any], _Pipeline]r   r   r   r   r   !Optional[list[Mapping[str, Any]]]r   r   ri   r   r   r   )r   objectr   r   r   r   r   r;   r^   r_   r   r     sn    3	I! 1 	
 * 9 & ! *:.!
r^   r   c                  z   ^  \ rS rSrSrSr      S                 SU 4S jjjrS	S jrS
S jrSr	U =r
$ )	UpdateOnei+  z#Represents an update_one operation.r;   c	           
     *   > [         T	U ]  XX4XVXx5        g)a{  Represents an update_one operation.

For use with :meth:`~pymongo.asynchronous.collection.AsyncCollection.bulk_write`, :meth:`~pymongo.collection.Collection.bulk_write`,
:meth:`~pymongo.asynchronous.mongo_client.AsyncMongoClient.bulk_write` and :meth:`~pymongo.mongo_client.MongoClient.bulk_write`.

:param filter: A query that matches the document to update.
:param update: The modifications to apply.
:param upsert: If ``True``, perform an insert if no documents
    match the filter.
:param collation: An instance of
    :class:`~pymongo.collation.Collation`.
:param array_filters: A list of filters specifying which
    array elements an update should apply.
:param hint: An index to use to support the query
    predicate specified either by its string name, or in the same
    format as passed to
    :meth:`~pymongo.asynchronous.collection.AsyncCollection.create_index` or :meth:`~pymongo.collection.Collection.create_index` (e.g.
    ``[('field', ASCENDING)]``). This option is only supported on
    MongoDB 4.2 and above.
:param namespace: The namespace in which to update a document.
:param sort: Specify which document the operation updates if the query matches
    multiple documents. The first document matched by the sort order will be updated.

.. versionchanged:: 4.10
    Added ``sort`` option.
.. versionchanged:: 4.9
   Added the `namespace` option to support `MongoClient.bulk_write`.
.. versionchanged:: 3.11
   Added the `hint` option.
.. versionchanged:: 3.9
   Added the ability to accept a pipeline as the `update`.
.. versionchanged:: 3.6
   Added the `array_filters` option.
.. versionchanged:: 3.5
   Added the `collation` option.
Nr   )
rg   r   r4   r   r   r   r   ri   r   r|   s
            r_   rj   UpdateOne.__init__0  s    ^ 	MQZar^   c                    UR                  U R                  U R                  S[        U R                  5      [        U R                  5      U R                  U R                  U R                  S9  g)rm   Fr   r   r   r   N)

add_updater   rd   r   r   r   r   r   r   r   ro   s     r_   rq   UpdateOne._add_to_bulka  sU    LLII0A-- 	 		
r^   c                   U R                   (       d  [        S5      eUR                  U R                   U R                  U R                  SU R
                  [        U R                  5      U R                  U R                  U R                  S9	  g)rt   ru   Fr   N)re   r   r   r   rd   r   r   r   r   r   r   ro   s     r_   rv   UpdateOne._add_to_client_bulkn  sp    "e  	OOLLIILL0A-- 	 
	
r^   )NNNNNN)r   r   r4   r   r   r   r   r   r   r   r   r   ri   r   r   r   r   r   r   r   r   r   s   @r_   r   r   +  s    -I "&,0;?(,#',0/b!/b 4/b 	/b
 */b 9/b &/b !/b */b 
/b /bb

 
r^   r   c                  t   ^  \ rS rSrSrSr     S               SU 4S jjjrS	S jrS
S jrSr	U =r
$ )
UpdateManyi  z$Represents an update_many operation.r;   c           
     ,   > [         TU ]  XX4XVUS5        g)a  Create an UpdateMany instance.

For use with :meth:`~pymongo.asynchronous.collection.AsyncCollection.bulk_write`, :meth:`~pymongo.collection.Collection.bulk_write`,
:meth:`~pymongo.asynchronous.mongo_client.AsyncMongoClient.bulk_write` and :meth:`~pymongo.mongo_client.MongoClient.bulk_write`.

:param filter: A query that matches the documents to update.
:param update: The modifications to apply.
:param upsert: If ``True``, perform an insert if no documents
    match the filter.
:param collation: An instance of
    :class:`~pymongo.collation.Collation`.
:param array_filters: A list of filters specifying which
    array elements an update should apply.
:param hint: An index to use to support the query
    predicate specified either by its string name, or in the same
    format as passed to
    :meth:`~pymongo.asynchronous.collection.AsyncCollection.create_index` or :meth:`~pymongo.collection.Collection.create_index` (e.g.
    ``[('field', ASCENDING)]``). This option is only supported on
    MongoDB 4.2 and above.
:param namespace: (optional) The namespace in which to update documents.

.. versionchanged:: 4.9
   Added the `namespace` option to support `MongoClient.bulk_write`.
.. versionchanged:: 3.11
   Added the `hint` option.
.. versionchanged:: 3.9
   Added the ability to accept a pipeline as the `update`.
.. versionchanged:: 3.6
   Added the `array_filters` option.
.. versionchanged:: 3.5
   Added the `collation` option.
Nr   )	rg   r   r4   r   r   r   r   ri   r|   s	           r_   rj   UpdateMany.__init__  s    T 	MQZ\`ar^   c           
         UR                  U R                  U R                  SU R                  [	        U R
                  5      U R                  U R                  S9  g)rm   Tr   r   r   N)r   r   rd   r   r   r   r   r   ro   s     r_   rq   UpdateMany._add_to_bulk  sI    LLIILL0A-- 	 	
r^   c                   U R                   (       d  [        S5      eUR                  U R                   U R                  U R                  SU R
                  [        U R                  5      U R                  U R                  S9  g)rt   ru   Tr  N)
re   r   r   r   rd   r   r   r   r   r   ro   s     r_   rv   UpdateMany._add_to_client_bulk  si    "e  	OOLLIILL0A-- 	 		
r^   r   )r   r   r4   r   r   r   r   r   r   r   r   r   ri   r   r   r   r   r   r   r   s   @r_   r  r    s    .I "&,0;?(,#'*b!*b 4*b 	*b
 **b 9*b &*b !*b 
*b *bX


 
r^   r  c                  D    \ rS rSrSrSrSS jr\S	S j5       rS
S jr	Sr
g)
IndexModeli  zRepresents an index to create.
__documentc                    [        U5      nUR                  S5      c  [        U5      US'   [        U5      US'   [	        UR                  SS5      5      nX l        Ub  X0R                  S'   gg)a8
  Create an Index instance.

For use with :meth:`~pymongo.asynchronous.collection.AsyncCollection.create_indexes` and :meth:`~pymongo.collection.Collection.create_indexes`.

Takes either a single key or a list containing (key, direction) pairs
or keys.  If no direction is given, :data:`~pymongo.ASCENDING` will
be assumed.
The key(s) must be an instance of :class:`str`, and the direction(s) must
be one of (:data:`~pymongo.ASCENDING`, :data:`~pymongo.DESCENDING`,
:data:`~pymongo.GEO2D`, :data:`~pymongo.GEOSPHERE`,
:data:`~pymongo.HASHED`, :data:`~pymongo.TEXT`).

Valid options include, but are not limited to:

  - `name`: custom name to use for this index - if none is
    given, a name will be generated.
  - `unique`: if ``True``, creates a uniqueness constraint on the index.
  - `background`: if ``True``, this index should be created in the
    background.
  - `sparse`: if ``True``, omit from the index any documents that lack
    the indexed field.
  - `bucketSize`: for use with geoHaystack indexes.
    Number of documents to group together within a certain proximity
    to a given longitude and latitude.
  - `min`: minimum value for keys in a :data:`~pymongo.GEO2D`
    index.
  - `max`: maximum value for keys in a :data:`~pymongo.GEO2D`
    index.
  - `expireAfterSeconds`: <int> Used to create an expiring (TTL)
    collection. MongoDB will automatically delete documents from
    this collection after <int> seconds. The indexed field must
    be a UTC datetime or the data will not expire.
  - `partialFilterExpression`: A document that specifies a filter for
    a partial index.
  - `collation`: An instance of :class:`~pymongo.collation.Collation`
    that specifies the collation to use.
  - `wildcardProjection`: Allows users to include or exclude specific
    field paths from a `wildcard index`_ using the { "$**" : 1} key
    pattern. Requires MongoDB >= 4.2.
  - `hidden`: if ``True``, this index will be hidden from the query
    planner and will not be evaluated as part of query plan
    selection. Requires MongoDB >= 4.4.

See the MongoDB documentation for a full list of supported options by
server version.

:param keys: a single key or a list containing (key, direction) pairs
     or keys specifying the index to create.
:param kwargs: any additional index creation
    options (see the above list) should be passed as keyword
    arguments.

.. versionchanged:: 3.11
   Added the ``hidden`` option.
.. versionchanged:: 3.2
   Added the ``partialFilterExpression`` option to support partial
   indexes.

.. _wildcard index: https://mongodb.com/docs/master/core/index-wildcard/
nameNkeyr   )r   getr   r   r   pop_IndexModel__document)rg   keyskwargsr   s       r_   rj   IndexModel.__init__  sk    z 4 ::f%,T2F6N'-u.vzz+t/LM	  +4OOK( !r^   c                    U R                   $ )zEAn index document suitable for passing to the createIndexes
command.
)r  r}   s    r_   rh   IndexModel.document  s    
 r^   c                   SR                  U R                  R                  U R                  S   SR	                  U R                  R                  5        VVs/ s H  u  pUS:w  d  M  SU SU< 3PM     snn5      5      $ s  snnf )Nz{}({}{})r   rz   =)r   r|   r<   rh   joinitemsrg   r  values      r_   r~   IndexModel.__repr__"  sy      NN##MM% GGDMM<O<O<Qb<QjcUX\aUa)r#ay)<Qbc
 	
 cs   B 'B N)r  _IndexKeyHintr  r   r   r   )r   zdict[str, Any]r   r<   r=   r>   r?   r   r   rj   propertyrh   r~   r]   r;   r^   r_   r  r    s*    (ID5L  
r^   r  c                  ^    \ rS rSrSrSr  S         S	S jjr\S
S j5       rSS jr	Sr
g)SearchIndexModeli*  z$Represents a search index to create.r  Nc                    0 U l         Ub  X R                   S'   XR                   S'   Ub  X0R                   S'   U R                   R                  U5        g)an  Create a Search Index instance.

For use with :meth:`~pymongo.collection.AsyncCollection.create_search_index` and :meth:`~pymongo.collection.AsyncCollection.create_search_indexes`.

:param definition: The definition for this index.
:param name: The name for this index, if present.
:param type: The type for this index which defaults to "search". Alternative values include "vectorSearch".
:param kwargs: Keyword arguments supplying any additional options.

.. note:: Search indexes require a MongoDB server version 7.0+ Atlas cluster.
.. versionadded:: 4.5
.. versionchanged:: 4.7
   Added the type and kwargs arguments.
Nr  
definitionr   )_SearchIndexModel__documentr4   )rg   r)  r  r   r  s        r_   rj   SearchIndexModel.__init__/  sM    * +-&*OOF#(2%&*OOF#v&r^   c                    U R                   $ )zThe document for this index.)r*  r}   s    r_   rh   SearchIndexModel.documentL  s     r^   c                    SR                  U R                  R                  SR                  U R                  R                  5        VVs/ s H  u  pU SU< 3PM     snn5      5      $ s  snnf )Nz{}({})rz   r  )r   r|   r<   r  rh   r  r   s      r_   r~   SearchIndexModel.__repr__Q  sZ    NN##IIDMM<O<O<QR<Qjc#ay)<QRS
 	
Rs   	A))NN)
r)  r   r  r   r   r   r  r   r   r   )r   r   r   r$  r;   r^   r_   r'  r'  *  s`    .I
 #"	'%' ' 	'
 ' 
':  
r^   r'  )4r   
__future__r   enumtypingr   r   r   r   r   r	   r
   r   bson.raw_bsonr   pymongor   pymongo.collationr   pymongo.commonr   r   pymongo.errorsr   pymongo.helpers_sharedr   r   r   pymongo.typingsr   r   r   pymongo.write_concernr   r   r   r   int
_IndexListr#  Enumr   ra   r   r   r   r   r   r   r  r  r'  r;   r^   r_   <module>r>     sG   # 	 	 	 * " 8 = + P P B B 2B U3c5c7383D)D#EEFFGH'RUWZRZJ[[
 c:o&#tyy @2!& 2!j7c 7ct:
	 :
z:
 :
zL
' L
^[
 [
|S
	 S
lL
 L
^W
 W
t+
 +
r^   