
    W
h                         S r SSKrSSKJrJr  SSKJr  \" \R                  SS 5      r	\	S:  a.  \R                  R                  \R                  R                  S9r
O\R                  r
 S
S jrSS	 jrg)zE
Helper functions, constants, and types to aid with PyMongo support.
    N)binary	json_util)OperationFailure      )uuid_representationc                    US:X  a  g0 nUb  X&S'   Ub  X6S'   US;  a  XFS'   Ub  XVS'   [         S:  a>   U(       d"  [        U5      S	1::  a  U R                  " S0 UD6$ U R                  " SS
U0UD6$ U R                  U5      nUR                  5        H  u  p[        X5      nU" U
5      nM     SU;   =(       d    SU;   nUR                  US9$ ! [         a4  n[         S:  a  e S[        U5      ;  a  S[        U5      ;  a  e  SnANSnAff = f)z9Pymongo>3.7 deprecates count in favour of count_documentsr   Nskiplimit)Nhint	collation      max_time_msfilterr   z@$geoNear, $near, and $nearSphere are not allowed in this contextz%$where is not allowed in this context)with_limit_and_skip )
PYMONGO_VERSIONsetestimated_document_countcount_documentsr   strfinditemsgetattrcount)
collectionr   r   r   r   r   kwargserrcursoroptionoption_valuecursor_methodr   s                cC:\Users\julio\Documents\inmuebles-mzt\backend\env\Lib\site-packages\mongoengine/pymongo_support.pyr   r      s7    zFvw:v'{ & 	c&km_< "::DVDD!11JJ6JJ  __V$F &/|, !/ !F*?g.?<<,?<@@)   	$& S3x ;3s8K	s   (C C 
D*DDc                     [         S:  a  U R                  5       nOU R                  5       nU(       d)  U Vs/ s H  o3R                  S5      (       a  M  UPM     nnU$ s  snf )zJPymongo>3.7 deprecates collection_names in favour of list_collection_namesr   zsystem.)r   list_collection_namescollection_names
startswith)dbinclude_system_collectionscollectionscs       r'   r)   r)   F   sR    & ..0))+%"-M+Q\\)5Lq+M Ns   AA)NNNN)F)__doc__pymongobsonr   r   pymongo.errorsr   tupleversion_tupler   LEGACY_JSON_OPTIONSwith_optionsUuidRepresentationPYTHON_LEGACYDEFAULT_JSON_OPTIONSr   r)   r       r'   <module>r<      s     " +--bq12 d#77DD"55CC E  $88 EI.Ab
r;   