Query filter for a List<Custom> Object

I have a Java Object as below which I sav in mongodb
I have the id and the height with me and I want to query and retrieve the Object back with the FeatureList only containing Items that have hght less than 4 .
So in the below example, I want t to retrieve the Object with a list of only one feature.

not able to get thee query working . any inputs to solve this.

env SpringBoot

{
    "_id": "12345",
    "featureList": [
        {
            "height": "5",
            "color: "black"
        },
        {
            "height": "3",
            "color: "brown"
        }
    ]
}

the following bson flter is not honoring th lte and giving me both the records

And Filter{filters=[Filter{fieldName='_id', value=12345}, Operator Filter{fieldName='featureList.height', operator='$lte', value=4}]}
1 Like

changed datatype of height to int and still its not helping.

I am getting the Object with the both the records in the feature List even when I say I have lte set as 4

Bson filter = and(eq("_id", 12345), lte("featureList.height", 4));		
		MyObject myObject = mongoCollection.find(filter).first();