Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

299
Views
Comprobar que existe un campo en Pymongo

Tengo una colección como esta:

 { "_id":"1321464" "Sex":"Male" "Age":"20" "City":"Toronto" #Maybe this field are not present. }

Quiero encontrar todos mis documentos con el campo "Ciudad" que no existe. Lo intento :

 collection.find({"sex":"Male"},{"City":{"$exists": False}},{'Age': 1, '_id':0})

Y tengo este mensaje de error:

 File "/usr/local/lib/python2.7/dist-packages/pymongo/collection.py", line 1239, in find return Cursor(self, *args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/pymongo/cursor.py", line 125, in __init__ raise TypeError("skip must be an instance of int") TypeError: skip must be an instance of int
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Estás pasando tres argumentos al método de find . Supongo que tenía la intención de pasar un filtro y una proyección solamente. Prueba esto:

 collection.find({"sex":"Male", "City":{"$exists": False}},{'Age': 1, '_id':0})
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!