i am facing a strange behaviuor with mongo-shell und Spring Data Mongodb
Here is my example query:
> db.substances.find({"precursor.mass": {$gte:159.9900,$lte:160.0100}}).count()
6
So i want to find mass values in a given range (plus/minus). In this example the input was 160 +/- 0.01.
Here are two out of the six results. The frist one is ok, but I can not explain and understand why the second result is found.
{
"_id" : ObjectId("524bfe80729458abfd7698a5"),
"exactMass" : 159.1259,
"nominalMass" : 159,
"molarMass" : 159.22,
"status" : 1,
"decompositions" : [ ],
"precursor" : [
{
"mass" : 160,
"ion" : "+H",
"charge" : "+",
"fragments" : [
55,
83,
124,
97,
69,
142
]
}
],
}
{
"_id" : ObjectId("524bfe80729458abfd7695be"),
"exactMass" : 159.068414,
"nominalMass" : 159,
"molarMass" : 159.19,
"status" : 0,
"decompositions" : [ ],
"precursor" : [
{
"mass" : 158.0611,
"ion" : "-H",
"charge" : "-",
"fragments" : [ ]
},
{
"mass" : 160.0756,
"ion" : "+H",
"charge" : "+",
"fragments" : [ ]
}
],
}
What am I overlooking? I Suppose i am using a wrong query?
My goal is to find all substances where ANY of the precursor.mass is between a given value +/- a tolerance.