o
    'h|                     @  s  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rdd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 de$ej(Z)G dd dee Z*G dd dZ+G dd de+Z,G dd de+Z-G dd dee Z.G dd dZ/G dd de/Z0G dd de/Z1G d d! d!Z2G d"d# d#Z3dS )$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                   @  s   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dS )_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 rX   rX   N/var/www/html/olx_land/venv/lib/python3.10/site-packages/pymongo/operations.pyr   5   s<    r   c                   @  sR   e Zd ZdZdZddd
dZdddZd ddZd!ddZd"ddZ	d"ddZ
dS )#	InsertOnez#Represents an insert_one operation._doc
_namespaceNdocumentr   	namespaceOptional[str]returnNonec                 C  s   || _ || _dS )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[   )selfr^   r_   rX   rX   rY   __init__]   s   
zInsertOne.__init__bulkobjr   c                 C  s   | | j dS )>Add this operation to the _AsyncBulk/_Bulk instance `bulkobj`.N)
add_insertr\   rc   re   rX   rX   rY   _add_to_bulkm   s   zInsertOne._add_to_bulkr   c                 C  s"   | j std|| j | j dS )JAdd this operation to the _AsyncClientBulk/_ClientBulk instance `bulkobj`.SMongoClient.bulk_write requires a namespace to be provided for each write operationN)r]   r   rg   r\   rh   rX   rX   rY   _add_to_client_bulkq   s   zInsertOne._add_to_client_bulkstrc                 C  s:   | j r| jj d| jd| j dS | jj d| jdS )N(, ))r]   	__class__r8   r\   rc   rX   rX   rY   __repr__|   s   zInsertOne.__repr__otherr   boolc                 C  s,   t |t | kr|j| jko|j| jkS tS N)typer\   r]   NotImplementedrc   rt   rX   rX   rY   __eq__   s   zInsertOne.__eq__c                 C  
   | |k S rv   rX   ry   rX   rX   rY   __ne__      
zInsertOne.__ne__rv   )r^   r   r_   r`   ra   rb   re   r   ra   rb   re   r   ra   rb   ra   rm   rt   r   ra   ru   )r8   r9   r:   __doc__	__slots__rd   ri   rl   rs   rz   r|   rX   rX   rX   rY   rZ   U   s    



rZ   c                   @  sD   e Zd ZdZdZ			ddddZdddZdddZdddZdS )	_DeleteOpz)Private base class for delete operations.)_filter
_collation_hintr]   NfilterMapping[str, Any]	collationOptional[_CollationIn]hintOptional[_IndexKeyHint]r_   r`   ra   rb   c                 C  sN   |d ur	t d| |d urt|tst|| _n|| _|| _|| _|| _d S )Nr   )	r   
isinstancerm   r   r   r   r   r   r]   rc   r   r   r   r_   rX   rX   rY   rd      s   

z_DeleteOp.__init__rt   r   ru   c                 C  s<   t |t | kr|j|j|j|jf| j| j| j| jfkS tS rv   )rw   r   r   r   r]   rx   ry   rX   rX   rY   rz      s   z_DeleteOp.__eq__c                 C  r{   rv   rX   ry   rX   rX   rY   r|      r}   z_DeleteOp.__ne__rm   c                 C  sJ   | j rd| jj| j| j| j| j S | jj d| jd| jd| jdS )Nz{}({!r}, {!r}, {!r}, {!r})rn   ro   rp   )r]   formatrq   r8   r   r   r   rr   rX   rX   rY   rs      s   &z_DeleteOp.__repr__NNN
r   r   r   r   r   r   r_   r`   ra   rb   r   r   	r8   r9   r:   r   r   rd   rz   r|   rs   rX   rX   rX   rY   r      s    


r   c                      B   e Zd ZdZdZ			dd fddZdddZdddZ  ZS )	DeleteOnez"Represents a delete_one operation.rX   Nr   r   r   r   r   r   r_   r`   ra   rb   c                      t  |||| dS )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superrd   r   rq   rX   rY   rd         zDeleteOne.__init__re   r   c                 C      |j | jdt| j| jd dS )rf      r   r   N
add_deleter   r   r   r   rh   rX   rX   rY   ri         
zDeleteOne._add_to_bulkr   c                 C  2   | j std|j| j | jdt| j| jd dS )rj   rk   Fmultir   r   Nr]   r   r   r   r   r   r   rh   rX   rX   rY   rl         
zDeleteOne._add_to_client_bulkr   r   r~   r   	r8   r9   r:   r   r   rd   ri   rl   __classcell__rX   rX   r   rY   r          
 	r   c                      r   )
DeleteManyz#Represents a delete_many operation.rX   Nr   r   r   r   r   r   r_   r`   ra   rb   c                   r   )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   r   rX   rY   rd     r   zDeleteMany.__init__re   r   c                 C  r   )rf   r   r   Nr   rh   rX   rX   rY   ri   &  r   zDeleteMany._add_to_bulkr   c                 C  r   )rj   rk   Tr   Nr   rh   rX   rX   rY   rl   /  r   zDeleteMany._add_to_client_bulkr   r   r~   r   r   rX   rX   r   rY   r     r   r   c                   @  s\   e Zd ZdZdZ					d'd(ddZd)ddZd*ddZd+d d!Zd+d"d#Z	d,d%d&Z
dS )-
ReplaceOnez#Represents a replace_one operation.)r   r\   _upsertr   r   r]   _sortNr   r   replacement%Union[_DocumentType, RawBSONDocument]upsertOptional[bool]r   r   r   r   r_   r`   sortOptional[Mapping[str, Any]]ra   rb   c                 C  sr   |dur	t d| |durtd| |dur"t|ts"t|| _n|| _|| _|| _|| _	|| _
|| _|| _dS )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   r   )r   r   r   rm   r   r   r   r   r   r\   r   r   r]   )rc   r   r   r   r   r   r_   r   rX   rX   rY   rd   K  s   (


zReplaceOne.__init__re   r   c                 C  s*   |j | j| j| jt| j| j| jd dS )rf   r   r   r   N)add_replacer   r\   r   r   r   r   r   rh   rX   rX   rY   ri     s   
zReplaceOne._add_to_bulkr   c              	   C  s<   | j std|j| j | j| j| jt| j| j| j	d dS )rj   rk   r   N)
r]   r   r   r   r\   r   r   r   r   r   rh   rX   rX   rY   rl     s   
zReplaceOne._add_to_client_bulkrt   r   ru   c                 C  sT   t |t | kr(|j|j|j|j|j|j|jf| j| j| j| j| j| j| jfkS tS rv   )	rw   r   r\   r   r   r   r]   r   rx   ry   rX   rX   rY   rz     s&   	zReplaceOne.__eq__c                 C  r{   rv   rX   ry   rX   rX   rY   r|     r}   zReplaceOne.__ne__rm   c              
   C  sV   | j rd| jj| j| j| j| j| j| j | j	S d| jj| j| j| j| j| j| j	S )N,{}({!r}, {!r}, {!r}, {!r}, {!r}, {!r}, {!r})z&{}({!r}, {!r}, {!r}, {!r}, {!r}, {!r}))
r]   r   rq   r8   r   r\   r   r   r   r   rr   rX   rX   rY   rs     s(   
zReplaceOne.__repr__NNNNN)r   r   r   r   r   r   r   r   r   r   r_   r`   r   r   ra   rb   r~   r   r   r   )r8   r9   r:   r   r   rd   ri   rl   rz   r|   rs   rX   rX   rX   rY   r   >  s    
8


r   c                   @  s<   e Zd ZdZdZd"ddZd#ddZd$ddZd%dd Zd!S )&	_UpdateOpz)Private base class for update operations.)r   r\   r   r   _array_filtersr   r]   r   r   r   doc#Union[Mapping[str, Any], _Pipeline]r   r   r   r   array_filters!Optional[list[Mapping[str, Any]]]r   r   r_   r`   r   r   c	           	      C  s   |d ur	t d| |d urtd| |d urtd| |d ur+t|ts+t|| _n|| _|| _|| _	|| _
|| _|| _|| _|| _d S )Nr   r   r   )r   r   r   r   rm   r   r   r   r   r\   r   r   r   r]   r   )	rc   r   r   r   r   r   r   r_   r   rX   rX   rY   rd     s    



z_UpdateOp.__init__rt   objectra   ru   c              	   C  sZ   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 rv   )r   rw   r   r\   r   r   r   r   r]   r   rx   ry   rX   rX   rY   rz     s*   
z_UpdateOp.__eq__r   c                 C  r{   rv   rX   ry   rX   rX   rY   r|     r}   z_UpdateOp.__ne__rm   c                 C  s^   | j rd| jj| j| j| j| j| j| j	| j | j
	S d| jj| j| j| j| j| j| j	| j
S )Nz2{}({!r}, {!r}, {!r}, {!r}, {!r}, {!r}, {!r}, {!r})r   )r]   r   rq   r8   r   r\   r   r   r   r   r   rr   rX   rX   rY   rs     s,   z_UpdateOp.__repr__N)r   r   r   r   r   r   r   r   r   r   r   r   r_   r`   r   r   )rt   r   ra   ru   r   r   r   rX   rX   rX   rY   r     s    


r   c                      sH   e Zd ZdZdZ						dd  fddZd!ddZd"ddZ  ZS )#	UpdateOnez#Represents an update_one operation.rX   Nr   r   r1   r   r   r   r   r   r   r   r   r   r_   r`   r   r   ra   rb   c	           	   
     s   t  |||||||| dS )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   r1   r   r   r   r   r_   r   r   rX   rY   rd   0  s   /zUpdateOne.__init__re   r   c              
   C  s4   |j | j| jdt| jt| j| j| j| j	d dS )rf   Fr   r   r   r   N)

add_updater   r\   ru   r   r   r   r   r   r   rh   rX   rX   rY   ri   a  s   
zUpdateOne._add_to_bulkr   c                 C  sB   | j std|j| j | j| jd| jt| j| j| j	| j
d	 dS )rj   rk   Fr   N)r]   r   r   r   r\   r   r   r   r   r   r   rh   rX   rX   rY   rl   n  s   
zUpdateOne._add_to_client_bulk)NNNNNN)r   r   r1   r   r   r   r   r   r   r   r   r   r_   r`   r   r   ra   rb   r~   r   r   rX   rX   r   rY   r   +  s    
1r   c                      sF   e Zd ZdZdZ					dd fddZdddZd ddZ  ZS )!
UpdateManyz$Represents an update_many operation.rX   Nr   r   r1   r   r   r   r   r   r   r   r   r   r_   r`   ra   rb   c              
     s   t  |||||||d dS )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   r1   r   r   r   r   r_   r   rX   rY   rd     s   *zUpdateMany.__init__re   r   c              	   C  s,   |j | j| jd| jt| j| j| jd dS )rf   Tr   r   r   N)r   r   r\   r   r   r   r   r   rh   rX   rX   rY   ri     s   
zUpdateMany._add_to_bulkr   c              
   C  s>   | j std|j| j | j| jd| jt| j| j| j	d dS )rj   rk   Tr   N)
r]   r   r   r   r\   r   r   r   r   r   rh   rX   rX   rY   rl     s   
zUpdateMany._add_to_client_bulkr   )r   r   r1   r   r   r   r   r   r   r   r   r   r_   r`   ra   rb   r~   r   r   rX   rX   r   rY   r     s    
,r   c                   @  s6   e Zd ZdZdZdd	d
ZedddZdddZdS )
IndexModelzRepresents an index to create.
__documentkeys_IndexKeyHintkwargsr   ra   rb   c                 K  s^   t |}|ddu rt||d< t||d< t|dd}|| _|dur-|| jd< dS dS )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://mongodb.com/docs/master/core/index-wildcard/
        nameNkeyr   )r   getr   r   r   pop_IndexModel__document)rc   r   r   r   rX   rX   rY   rd     s   =zIndexModel.__init__dict[str, Any]c                 C     | j S )zUAn index document suitable for passing to the createIndexes
        command.
        )r   rr   rX   rX   rY   r^     s   zIndexModel.documentrm   c              	   C  s.   d | jj| jd ddd | j D S )Nz{}({}{})r    c                 S  s(   g | ]\}}|d krd| d|qS )r   ro   =rX   .0r   valuerX   rX   rY   
<listcomp>&  s   ( z'IndexModel.__repr__.<locals>.<listcomp>)r   rq   r8   r^   joinitemsrr   rX   rX   rY   rs   "  s
   zIndexModel.__repr__N)r   r   r   r   ra   rb   )ra   r   r   	r8   r9   r:   r   r   rd   propertyr^   rs   rX   rX   rX   rY   r     s    
Fr   c                   @  s<   e Zd ZdZdZ		ddddZedddZdddZdS )SearchIndexModelz$Represents a search index to create.r   N
definitionr   r   r`   rw   r   r   ra   rb   c                 K  sD   i | _ |dur|| j d< || j d< |dur|| j d< | j | dS )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   r   rw   )_SearchIndexModel__documentr1   )rc   r   r   rw   r   rX   rX   rY   rd   /  s   


zSearchIndexModel.__init__c                 C  r   )zThe document for this index.)r   rr   rX   rX   rY   r^   L  s   zSearchIndexModel.documentrm   c                 C  s&   d | jjddd | j D S )Nz{}({})ro   c                 S  s   g | ]\}}| d |qS )r   rX   r   rX   rX   rY   r   T  s    z-SearchIndexModel.__repr__.<locals>.<listcomp>)r   rq   r8   r   r^   r   rr   rX   rX   rY   rs   Q  s   zSearchIndexModel.__repr__)NN)
r   r   r   r`   rw   r`   r   r   ra   rb   )ra   r   r   r   rX   rX   rX   rY   r   *  s    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   rm   int
_IndexListr   Enumr   rZ   r   r   r   r   r   r   r   r   r   rX   rX   rX   rY   <module>   s<   (4 5:== ^VOZ