Seeing some strange behavior in Pymongo $in
query. Looking for records that meet the following query:
speciesCollection.find({"SPCOMNAME":{"$in":['paddlefish','lake sturgeon']}})
The query returns no records.
If I change it to find_one the it works returning the last value for Lake Sturgeon. The field is a text filed with one vaule. So I am looking for records that match paddlefish or Lake Sturgeon.
It works fine in Mongo Shell like this:
speciesCollection.find({SPCOMNAME:{$in: ['paddlefish','lake strugeon']}},{_id:0})
Here is the result from shell
{ "SPECIES_ID" : 1, "SPECIES_AB" : "LKS", "SPCOMNAME" : "lake sturgeon", "SP_SCINAME" : "Acipenser fulvescens
{ "SPECIES_ID" : 101, "SPECIES_AB" : "PAH", "SPCOMNAME" : "paddlefish", "SP_SCINAME" : "Polyodon spathula" }
Am I missing something here?