从我的集合中,我只想返回记录中包含位置或地点信息(包括坐标)的记录。因此,如果任一条件不为空,则它将检索其中一个或两个字段(如果两个条件都不为空)。
到目前为止我的查询是这样的:
cursor = coll.find({"$or" : [{"place.bounding_box.type" : {"$ne" : None }}, {"coordinates.type" : {"$ne" : None }}]}, {"coordinates.coordinates" :1},
{"place.bounding_box.coordinates" : 1}, tailable = True, timeout = False)
但是我收到这个 pymongo 错误:
raise TypeError("skip must be an instance of int")
TypeError: skip must be an instance of int
我可以让查询单独工作,但不能像上面那样在联接查询中工作。
谢谢
最佳答案
该错误听起来像是您在结果光标上执行 .skip("string") 操作。
此外,您还应该阅读 $exists。
关于python - Mongo集合查询和运算符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13385043/