Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

294
Vistas
Check Field Exist in Pymongo

I have a collection like this :

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

I want to find all my document with the field "City" not exist. I try :

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

And i have this error message :

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 Respuestas
Responde la pregunta

0

You're passing three arguments to the find method. I assume you intended to pass a filter and a projection only. Try this:

collection.find({"sex":"Male", "City":{"$exists": False}},{'Age': 1, '_id':0})
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda