Here is my screenshot, I don't understand why sometimes value being stored as a a number and sometimes as NumberInt.
And When i am try this query for search
{
"price.egglessPrice" : { '$gt' : 360, '$lt':370}
}
I always get the result including above screenshot. but this is not right ans. There is no price lies between 360 to 370.
The reason behind different data type of number value depends on how you are storing your value. And you have to use $elemMatch here for matching the results:
db.collection.find({
price: {
$elemMatch: {egglessPrice: { $gt: 360, $lt: 370}}
}
});