我收藏的文件看起来像这样-
{'_id' : 'Delhi1', 'loc' : [28.34242,77.656565] }
{'_id' : 'Delhi2', 'loc' : [27.34242,78.626523] }
{'_id' : 'Delhi3', 'loc' : [25.34242,77.612345] }
{'_id' : 'Delhi4', 'loc' : [28.34242,77.676565] }
我想使用pymongo应用聚合,根据输入latlong查找相关文档。我已经在'loc'上创建了索引。以下是我目前所做的-
^{pr2}$但这对我不管用?如何正确使用这个?在
实际上,我在collection中创建了'2dsphere'索引,要将geonore与2dsphere一起使用,我们需要在管道中指定sphere=True
不需要运算符1)也不需要小括号2)也不需要括号。在
相关问题 更多 >
编程相关推荐