Pymongo $in Query Not Working

不问归期 提交于 2019-12-05 03:42:41

I think you have a typo or some other error in your program as I just did a test with your sample data and query and it works - see the GIF

Below is my test code which connects to the database called so and the collection speciesCollection, maybe you find the error in yours with it

import pymongo

client = pymongo.MongoClient('dockerhostlinux1', 30000)
db = client.so
coll = db.speciesCollection

result = coll.find({"SPCOMNAME":{"$in":['paddlefish','lake sturgeon']}})
for doc in result:
    print(doc)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!