Ë
    Ü_Ëi®|  ã                  ó.  — d Z ddlmZ ddlZddlmZmZmZmZm	Z	m
Z
mZmZ ddlmZ ddlmZ ddlmZ ddlmZmZ dd	lmZ dd
lmZmZmZ ddlmZmZmZ ddl m!Z! erddlm"Z"m#Z# ee
ee$ee$ee%e$ee$ef   f   f   f      ee$ef   f   Z&ee$e&f   Z' G d„ de$ejP                  «      Z) G d„ dee   «      Z* G d„ d«      Z+ G d„ de+«      Z, G d„ de+«      Z- G d„ dee   «      Z. G d„ d«      Z/ G d„ de/«      Z0 G d„ de/«      Z1 G d „ d!«      Z2 G d"„ d#«      Z3y)$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                  ó€   — e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZy)Ú_OpÚ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ÚtestOperationN) Ú__name__Ú
__module__Ú__qualname__Ú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© ó    úU/var/www/pod-logistic/pod-api/venv/lib/python3.12/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                  óF   — e Zd ZdZdZd
dd„Zdd„Zdd„Zdd„Zdd„Z	dd	„Z
y)Ú	InsertOnez#Represents an insert_one operation.©Ú_docÚ
_namespaceNc                ó    — || _         || _        y)av  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`.
        Nr_   )ÚselfÚdocumentÚ	namespaces      r\   Ú__init__zInsertOne.__init__]   s   € ð ˆŒ	Ø#ˆ�r[   c                ó:   — |j                  | j                  «       y)ú>Add this operation to the _AsyncBulk/_Bulk instance `bulkobj`.N)Ú
add_insertr`   ©rc   Úbulkobjs     r\   Ú_add_to_bulkzInsertOne._add_to_bulkm   s   € à×Ñ˜4Ÿ9™9Õ%r[   c                ó~   — | j                   st        d«      ‚|j                  | j                   | j                  «       y)úJAdd this operation to the _AsyncClientBulk/_ClientBulk instance `bulkobj`.úSMongoClient.bulk_write requires a namespace to be provided for each write operationN)ra   r   ri   r`   rj   s     r\   Ú_add_to_client_bulkzInsertOne._add_to_client_bulkq   s7   € à�ŠÜ"Øeóð ð 	×ÑØ�O‰OØ�I‰Iõ	
r[   c                óÌ   — | j                   r3| j                  j                  › d| j                  ›d| j                   ›d�S | j                  j                  › d| j                  ›d�S )Nú(ú, ú))ra   Ú	__class__r:   r`   ©rc   s    r\   Ú__repr__zInsertOne.__repr__|   sY   € Ø�?Š?Ø—n‘n×-Ñ-Ð.¨a°·	±	¨}¸B¸t¿¹Ð>QÐQRÐSÐSØ—.‘.×)Ñ)Ð*¨!¨D¯I©I¨=¸Ð:Ð:r[   c                ó¤   — t        |«      t        | «      k(  r4|j                  | j                  k(  xr |j                  | j                  k(  S t        S ©N)Útyper`   ra   ÚNotImplemented©rc   Úothers     r\   Ú__eq__zInsertOne.__eq__�   s?   € Ü�‹;œ$˜t›*Ò$Ø—:‘: §¡Ñ*ÒR¨u×/?Ñ/?À4Ç?Á?Ñ/RÐRÜÐr[   c                ó   — | |k(   S ry   rZ   r|   s     r\   Ú__ne__zInsertOne.__ne__†   ó   € Ø˜5‘=Ð Ð r[   ry   )rd   r   re   úOptional[str]ÚreturnÚNone©rk   r   rƒ   r„   ©rk   r   rƒ   r„   ©rƒ   Ústr©r}   r   rƒ   Úbool)r:   r;   r<   Ú__doc__Ú	__slots__rf   rl   rp   rw   r~   r€   rZ   r[   r\   r^   r^   U   s*   „ Ù-ð€Iô
$ó &ó	
ó;ó
ô
!r[   r^   c                  óN   — e Zd ZdZdZ	 	 	 d	 	 	 	 	 	 	 	 	 d	d„Zd
d„Zd
d„Zdd„Zy)Ú	_DeleteOpz)Private base class for delete operations.)Ú_filterÚ
_collationÚ_hintra   Nc                ó²   — |�t        d|«       |�+t        |t        «      st        j                  |«      | _        n|| _        || _        || _        || _        y )NÚfilter)	r   Ú
isinstancerˆ   r   r   r‘   r�   r�   ra   )rc   r“   Ú	collationÚhintre   s        r\   rf   z_DeleteOp.__init__”   sR   € ð ÐÜ ¨&Ô1ØÐ¤J¨t´SÔ$9Ü;I×;YÑ;YÐZ^Ó;_ˆD�JàˆDŒJàˆŒØ#ˆŒØ#ˆ�r[   c                óö   — t        |«      t        | «      k(  r]|j                  |j                  |j                  |j                  f| j                  | j                  | j                  | j                  fk(  S t
        S ry   )rz   r�   r�   r‘   ra   r{   r|   s     r\   r~   z_DeleteOp.__eq__¦   sl   € Ü�‹;œ$˜t›*Ò$à—‘Ø× Ñ Ø—‘Ø× Ñ ð	ð —‘Ø—‘Ø—
‘
Ø—‘ð	ñ
ð 
ô Ðr[   c                ó   — | |k(   S ry   rZ   r|   s     r\   r€   z_DeleteOp.__ne__µ   r�   r[   c                ó<  — | j                   rQdj                  | j                  j                  | j                  | j
                  | j                  | j                   «      S | j                  j                  › d| j                  ›d| j
                  ›d| j                  ›d�S )Nz{}({!r}, {!r}, {!r}, {!r})rr   rs   rt   )ra   Úformatru   r:   r�   r�   r‘   rv   s    r\   rw   z_DeleteOp.__repr__¸   s…   € Ø�?Š?Ø/×6Ñ6Ø—‘×'Ñ'Ø—‘Ø—‘Ø—
‘
Ø—‘óð ð —.‘.×)Ñ)Ð*¨!¨D¯L©LÐ+;¸2¸d¿o¹oÐ=PÐPRÐSW×S]ÑS]ÐR`Ð`aÐbÐbr[   ©NNN©
r“   úMapping[str, Any]r•   úOptional[_CollationIn]r–   úOptional[_IndexKeyHint]re   r‚   rƒ   r„   r‰   r‡   ©	r:   r;   r<   r‹   rŒ   rf   r~   r€   rw   rZ   r[   r\   rŽ   rŽ   Š   s\   „ Ù3ð€Ið -1Ø(,Ø#'ð$à!ð$ð *ð$ð &ð	$ð
 !ð$ð 
ó$ó$ó!ô	cr[   rŽ   c                  óR   ‡ — e Zd ZdZdZ	 	 	 d	 	 	 	 	 	 	 	 	 dˆ fd„Zdd„Zd	d„Zˆ xZS )
Ú	DeleteOnez"Represents a delete_one operation.rZ   c                ó*   •— t         ‰| �  ||||«       y)aÍ  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©Úsuperrf   ©rc   r“   r•   r–   re   ru   s        €r\   rf   zDeleteOne.__init__É   ó   ø€ ô< 	‰Ñ˜ ¨D°)Õ<r[   c                ó|   — |j                  | j                  dt        | j                  «      | j                  ¬«       y)rh   é   ©r•   r–   N©Ú
add_deleter�   r   r�   r‘   rj   s     r\   rl   zDeleteOne._add_to_bulké   ó2   € à×ÑØ�L‰LØÜ0°·±ÓAØ—‘ð	 	õ 	
r[   c                óÀ   — | j                   st        d«      ‚|j                  | j                   | j                  dt	        | j
                  «      | j                  ¬«       y)rn   ro   F©Úmultir•   r–   N©ra   r   r¬   r�   r   r�   r‘   rj   s     r\   rp   zDeleteOne._add_to_client_bulkò   sR   € à�ŠÜ"Øeóð ð 	×ÑØ�O‰OØ�L‰LØÜ0°·±ÓAØ—‘ð 	õ 	
r[   r›   rœ   r…   r†   ©	r:   r;   r<   r‹   rŒ   rf   rl   rp   Ú__classcell__©ru   s   @r\   r¢   r¢   Ä   sV   ø„ Ù,à€Ið
 -1Ø(,Ø#'ð=à!ð=ð *ð=ð &ð	=ð
 !ð=ð 
õ=ó@
÷
r[   r¢   c                  óR   ‡ — e Zd ZdZdZ	 	 	 d	 	 	 	 	 	 	 	 	 dˆ fd„Zdd„Zd	d„Zˆ xZS )
Ú
DeleteManyz#Represents a delete_many operation.rZ   c                ó*   •— t         ‰| �  ||||«       y)aÎ  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\   rf   zDeleteMany.__init__  r§   r[   c                ó|   — |j                  | j                  dt        | j                  «      | j                  ¬«       y)rh   r   rª   Nr«   rj   s     r\   rl   zDeleteMany._add_to_bulk&  r­   r[   c                óÀ   — | j                   st        d«      ‚|j                  | j                   | j                  dt	        | j
                  «      | j                  ¬«       y)rn   ro   Tr¯   Nr±   rj   s     r\   rp   zDeleteMany._add_to_client_bulk/  sR   € à�ŠÜ"Øeóð ð 	×ÑØ�O‰OØ�L‰LØÜ0°·±ÓAØ—‘ð 	õ 	
r[   r›   rœ   r…   r†   r²   r´   s   @r\   r¶   r¶     sV   ø„ Ù-à€Ið
 -1Ø(,Ø#'ð=à!ð=ð *ð=ð &ð	=ð
 !ð=ð 
õ=ó@
÷
r[   r¶   c                  ón   — e Zd ZdZdZ	 	 	 	 	 d
	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zdd„Zdd„Zdd„Zdd„Z	dd	„Z
y)Ú
ReplaceOnez#Represents a replace_one operation.)r�   r`   Ú_upsertr�   r‘   ra   Ú_sortNc                óø   — |�t        d|«       |�t        d|«       |�+t        |t        «      st	        j
                  |«      | _        n|| _        || _        || _        || _	        || _
        || _        || _        y)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�   r`   r¼   r�   ra   )rc   r“   Úreplacementr¿   r•   r–   re   Úsorts           r\   rf   zReplaceOne.__init__K  sx   € ðP ÐÜ ¨&Ô1ØÐÜ˜X vÔ.ØÐ¤J¨t´SÔ$9Ü;I×;YÑ;YÐZ^Ó;_ˆD�JàˆDŒJàˆŒ
ØˆŒØˆŒ	ØˆŒØ#ˆŒØ#ˆ�r[   c                ó¼   — |j                  | j                  | j                  | j                  t	        | j
                  «      | j                  | j                  ¬«       y)rh   ©r•   r–   rÁ   N)Úadd_replacer�   r`   r¼   r   r�   r‘   r½   rj   s     r\   rl   zReplaceOne._add_to_bulkƒ  sD   € à×ÑØ�L‰LØ�I‰IØ�L‰LÜ0°·±ÓAØ—‘Ø—‘ð 	õ 	
r[   c           	     ó   — | j                   st        d«      ‚|j                  | j                   | j                  | j                  | j
                  t        | j                  «      | j                  | j                  ¬«       y)rn   ro   rÃ   N)
ra   r   rÄ   r�   r`   r¼   r   r�   r‘   r½   rj   s     r\   rp   zReplaceOne._add_to_client_bulkŽ  sd   € à�ŠÜ"Øeóð ð 	×ÑØ�O‰OØ�L‰LØ�I‰IØ�L‰LÜ0°·±ÓAØ—‘Ø—‘ð 	õ 	
r[   c                óz  — t        |«      t        | «      k(  rŸ|j                  |j                  |j                  |j                  |j
                  |j                  |j                  f| j                  | j                  | j                  | j                  | j
                  | j                  | j                  fk(  S t        S ry   )	rz   r�   r`   r¼   r�   r‘   ra   r½   r{   r|   s     r\   r~   zReplaceOne.__eq__ž  s–   € Ü�‹;œ$˜t›*Ò$à—‘Ø—
‘
Ø—‘Ø× Ñ Ø—‘Ø× Ñ Ø—‘ðð —‘Ø—	‘	Ø—‘Ø—‘Ø—
‘
Ø—‘Ø—
‘
ðñð ô" Ðr[   c                ó   — | |k(   S ry   rZ   r|   s     r\   r€   zReplaceOne.__ne__³  r�   r[   c           
     óÌ  — | j                   rrdj                  | j                  j                  | j                  | j
                  | j                  | j                  | j                  | j                   | j                  «      S dj                  | j                  j                  | j                  | j
                  | j                  | j                  | j                  | j                  «      S )Nú,{}({!r}, {!r}, {!r}, {!r}, {!r}, {!r}, {!r})z&{}({!r}, {!r}, {!r}, {!r}, {!r}, {!r}))
ra   rš   ru   r:   r�   r`   r¼   r�   r‘   r½   rv   s    r\   rw   zReplaceOne.__repr__¶  s¦   € Ø�?Š?ØA×HÑHØ—‘×'Ñ'Ø—‘Ø—	‘	Ø—‘Ø—‘Ø—
‘
Ø—‘Ø—
‘
ó	ð 	ð 8×>Ñ>Ø�N‰N×#Ñ#Ø�L‰LØ�I‰IØ�L‰LØ�O‰OØ�J‰JØ�J‰Jó
ð 	
r[   ©NNNNN)r“   r�   rÀ   z%Union[_DocumentType, RawBSONDocument]r¿   úOptional[bool]r•   rž   r–   rŸ   re   r‚   rÁ   úOptional[Mapping[str, Any]]rƒ   r„   r…   r†   r‰   r‡   )r:   r;   r<   r‹   rŒ   rf   rl   rp   r~   r€   rw   rZ   r[   r\   r»   r»   >  sŠ   „ Ù-ð€Ið "&Ø,0Ø(,Ø#'Ø,0ð6$à!ð6$ð ;ð6$ð ð	6$ð
 *ð6$ð &ð6$ð !ð6$ð *ð6$ð 
ó6$óp	
ó
ó ó*!ô
r[   r»   c                  óT   — e Zd ZdZdZ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd„Zd	d„Zd
d„Zdd„Zy)Ú	_UpdateOpz)Private base class for update operations.)r�   r`   r¼   r�   Ú_array_filtersr‘   ra   r½   c	                ó"  — |�t        d|«       |�t        d|«       |�t        d|«       |�+t        |t        «      st        j                  |«      | _        n|| _        || _        || _	        || _
        || _        || _        || _        || _        y )Nr“   r¿   Úarray_filters)r   r   r   r”   rˆ   r   r   r‘   r�   r`   r¼   r�   rÏ   ra   r½   )	rc   r“   Údocr¿   r•   rÑ   r–   re   rÁ   s	            r\   rf   z_UpdateOp.__init__Û  s�   € ð ÐÜ ¨&Ô1ØÐÜ˜X vÔ.ØÐ$Ü˜/¨=Ô9ØÐ¤J¨t´SÔ$9Ü;I×;YÑ;YÐZ^Ó;_ˆD�JàˆDŒJØˆŒØˆŒ	ØˆŒØ#ˆŒØ+ˆÔØ#ˆŒØˆ�
r[   c           	     ó¢  — t        |t        | «      «      rµ|j                  |j                  |j                  |j
                  |j                  |j                  |j                  |j                  f| j                  | j                  | j                  | j
                  | j                  | j                  | j                  | j                  fk(  S t        S ry   )r”   rz   r�   r`   r¼   r�   rÏ   r‘   ra   r½   r{   r|   s     r\   r~   z_UpdateOp.__eq__ø  s¦   € Ü�eœT $›ZÔ(à—‘Ø—
‘
Ø—‘Ø× Ñ Ø×$Ñ$Ø—‘Ø× Ñ Ø—‘ð	ð —‘Ø—	‘	Ø—‘Ø—‘Ø×#Ñ#Ø—
‘
Ø—‘Ø—
‘
ð	ñð ô& Ðr[   c                ó   — | |k(   S ry   rZ   r|   s     r\   r€   z_UpdateOp.__ne__  r�   r[   c                óø  — | j                   r}dj                  | j                  j                  | j                  | j
                  | j                  | j                  | j                  | j                  | j                   | j                  «	      S dj                  | j                  j                  | j                  | j
                  | j                  | j                  | j                  | j                  | j                  «      S )Nz2{}({!r}, {!r}, {!r}, {!r}, {!r}, {!r}, {!r}, {!r})rÉ   )ra   rš   ru   r:   r�   r`   r¼   r�   rÏ   r‘   r½   rv   s    r\   rw   z_UpdateOp.__repr__  s¸   € Ø�?Š?ØG×NÑNØ—‘×'Ñ'Ø—‘Ø—	‘	Ø—‘Ø—‘Ø×#Ñ#Ø—
‘
Ø—‘Ø—
‘
ó
ð 
ð >×DÑDØ�N‰N×#Ñ#Ø�L‰LØ�I‰IØ�L‰LØ�O‰OØ×ÑØ�J‰JØ�J‰Jó	
ð 		
r[   N)r“   r�   rÒ   ú#Union[Mapping[str, Any], _Pipeline]r¿   rË   r•   rž   rÑ   ú!Optional[list[Mapping[str, Any]]]r–   rŸ   re   r‚   rÁ   rÌ   )r}   Úobjectrƒ   rŠ   r‰   r‡   r    rZ   r[   r\   rÎ   rÎ   Í  sn   „ Ù3ð	€Iðà!ðð 1ðð ð	ð
 *ðð 9ðð &ðð !ðð *óó:ó.!ô
r[   rÎ   c                  óh   ‡ — e Zd ZdZdZ	 	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dˆ fd„Zdd„Zd	d„Zˆ xZS )
Ú	UpdateOnez#Represents an update_one operation.rZ   c	           
     ó2   •— t         ‰	| �  ||||||||«       y)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¤   )
rc   r“   r3   r¿   r•   rÑ   r–   re   rÁ   ru   s
            €r\   rf   zUpdateOne.__init__0  s#   ø€ ô^ 	‰Ñ˜ ¨°¸MÈ4ÐQZÐ\`Õar[   c           
     óæ   — |j                  | j                  | j                  dt        | j                  «      t        | j                  «      | j                  | j                  | j                  ¬«       y)rh   F©r•   rÑ   r–   rÁ   N)
Ú
add_updater�   r`   rŠ   r¼   r   r�   rÏ   r‘   r½   rj   s     r\   rl   zUpdateOne._add_to_bulka  sU   € à×ÑØ�L‰LØ�I‰IØÜ�—‘ÓÜ0°·±ÓAØ×-Ñ-Ø—‘Ø—‘ð 	õ 		
r[   c                ó  — | j                   st        d«      ‚|j                  | j                   | j                  | j                  d| j
                  t        | j                  «      | j                  | j                  | j                  ¬«	       y)rn   ro   FrÝ   N)ra   r   rÞ   r�   r`   r¼   r   r�   rÏ   r‘   r½   rj   s     r\   rp   zUpdateOne._add_to_client_bulkn  sp   € à�ŠÜ"Øeóð ð 	×ÑØ�O‰OØ�L‰LØ�I‰IØØ�L‰LÜ0°·±ÓAØ×-Ñ-Ø—‘Ø—‘ð 	õ 
	
r[   )NNNNNN)r“   r�   r3   rÖ   r¿   rË   r•   rž   rÑ   r×   r–   rŸ   re   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
÷
r[   rÚ   c                  ób   ‡ — e Zd ZdZdZ	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dˆ fd„Zdd„Zd	d„Zˆ xZS )
Ú
UpdateManyz$Represents an update_many operation.rZ   c           
     ó2   •— t         ‰| �  |||||||d«       y)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¤   )	rc   r“   r3   r¿   r•   rÑ   r–   re   ru   s	           €r\   rf   zUpdateMany.__init__†  s#   ø€ ôT 	‰Ñ˜ ¨°¸MÈ4ÐQZÐ\`Õar[   c           	     ó¾   — |j                  | j                  | j                  d| j                  t	        | j
                  «      | j                  | j                  ¬«       y)rh   T©r•   rÑ   r–   N)rÞ   r�   r`   r¼   r   r�   rÏ   r‘   rj   s     r\   rl   zUpdateMany._add_to_bulk²  sI   € à×ÑØ�L‰LØ�I‰IØØ�L‰LÜ0°·±ÓAØ×-Ñ-Ø—‘ð 	õ 	
r[   c           
     ó  — | j                   st        d«      ‚|j                  | j                   | j                  | j                  d| j
                  t        | j                  «      | j                  | j                  ¬«       y)rn   ro   Trä   N)
ra   r   rÞ   r�   r`   r¼   r   r�   rÏ   r‘   rj   s     r\   rp   zUpdateMany._add_to_client_bulk¾  si   € à�ŠÜ"Øeóð ð 	×ÑØ�O‰OØ�L‰LØ�I‰IØØ�L‰LÜ0°·±ÓAØ×-Ñ-Ø—‘ð 	õ 		
r[   rÊ   )r“   r�   r3   rÖ   r¿   rË   r•   rž   rÑ   r×   r–   rŸ   re   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óX

÷
r[   rá   c                  ó6   — e Zd ZdZdZdd„Zedd„«       Zd	d„Zy)
Ú
IndexModelzRepresents an index to create.©Ú
__documentc                óÜ   — t        |«      }|j                  d«      €t        |«      |d<   t        |«      |d<   t	        |j                  dd«      «      }|| _        |�|| j                  d<   yy)aË  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://dochub.mongodb.org/core/index-wildcard/
        ÚnameNÚkeyr•   )r   Úgetr   r   r   ÚpopÚ_IndexModel__document)rc   ÚkeysÚkwargsr•   s       r\   rf   zIndexModel.__init__Õ  so   € ôz ˜4Ó ˆØ�:‰:�fÓÐ%Ü,¨TÓ2ˆF�6‰NÜ'¨Ó-ˆˆu‰Ü.¨v¯z©z¸+ÀtÓ/LÓMˆ	Ø ˆŒØÐ Ø+4ˆD�O‰O˜KÒ(ð !r[   c                ó   — | j                   S )zUAn index document suitable for passing to the createIndexes
        command.
        )rï   rv   s    r\   rd   zIndexModel.document  s   € ð
 �‰Ðr[   c                ó  — dj                  | j                  j                  | j                  d   dj	                  | j                  j                  «       D ��cg c]  \  }}|dk7  sŒd|› d|›�‘Œ c}}«      «      S c c}}w )Nz{}({}{})rì   Ú rs   ú=)rš   ru   r:   rd   ÚjoinÚitems©rc   rì   Úvalues      r\   rw   zIndexModel.__repr__"  sr   € Ø× Ñ Ø�N‰N×#Ñ#Ø�M‰M˜%Ñ Ø�G‰G¸D¿M¹M×<OÑ<OÓ<Q×b©j¨c°5ÐUXÐ\aÓUa�r˜#˜˜a ˜yÒ)ÓbÓcó
ð 	
ùó cs   ÁA;Á%
A;N)rð   Ú_IndexKeyHintrñ   r   rƒ   r„   )rƒ   zdict[str, Any]r‡   ©	r:   r;   r<   r‹   rŒ   rf   Úpropertyrd   rw   rZ   r[   r\   rç   rç   Ð  s*   „ Ù(à€IóD5ðL òó ðô
r[   rç   c                  óN   — e Zd ZdZdZ	 	 d	 	 	 	 	 	 	 	 	 dd„Zed	d„«       Zd
d„Zy)ÚSearchIndexModelz$Represents a search index to create.rè   Nc                óª   — i | _         |�|| j                   d<   || j                   d<   |�|| j                   d<   | j                   j                  |«       y)a¾  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ë   Ú
definitionrz   )Ú_SearchIndexModel__documentr3   )rc   r   rë   rz   rñ   s        r\   rf   zSearchIndexModel.__init__/  sS   € ð* +-ˆŒØÐØ&*ˆD�O‰O˜FÑ#Ø(2ˆ�‰˜Ñ%ØÐØ&*ˆD�O‰O˜FÑ#Ø�‰×Ñ˜vÕ&r[   c                ó   — | j                   S )zThe document for this index.)r  rv   s    r\   rd   zSearchIndexModel.documentL  s   € ð �‰Ðr[   c                óØ   — dj                  | j                  j                  dj                  | j                  j                  «       D ��cg c]  \  }}|› d|›�‘Œ c}}«      «      S c c}}w )Nz{}({})rs   rõ   )rš   ru   r:   rö   rd   r÷   rø   s      r\   rw   zSearchIndexModel.__repr__Q  sV   € Ø�‰Ø�N‰N×#Ñ#Ø�I‰I¸D¿M¹M×<OÑ<OÓ<Q×R©j¨c°5˜#˜˜a ˜yÒ)ÓRÓSó
ð 	
ùãRs   Á	A&)NN)
r   r�   rë   r‚   rz   r‚   rñ   r   rƒ   r„   )rƒ   r�   r‡   rû   rZ   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   r^   rŽ   r¢   r¶   r»   rÎ   rÚ   rá   rç   rþ   rZ   r[   r\   ú<module>r     sG  ðñõ #ã ÷	÷ 	ó 	õ *Ý "Ý 8ß =Ý +ß PÑ Pß BÑ BÝ 2áßBð ØˆU�3˜˜c 5¨¨c°7¸3À¸8Ñ3DÐ)DÑ#EÐEÑFÐFÑGÑHÈ'ÐRUÐWZÐRZÑJ[Ð[ñ€
ð �c˜:�oÑ&€ôˆ#ˆt�y‰yô ô@2!�˜Ñ&ô 2!÷j7cñ 7côt:
�	ô :
ôz:
�ô :
ôzL
�˜Ñ'ô L
÷^[
ñ [
ô|S
�	ô S
ôlL
�ô L
÷^W
ñ W
÷t+
ò +
r[   