I have MongoDB Document parameter of type "real" number but is represented in the DB as a string- e.g "cId"="200" instead of "cId"=200I have to query the DB for a range of numbers; e.g. filter equivalent to SELECT ALL where cId is less than 10 and greater than 5.
Is there a way to query the integer value of this parameter using a similar functional equivalent to Integer.parseInt(str); for example
My filter looks like
Bson filter = Filters.and(Filters.gt("cId", "0"), Filters.lt("cId","4"));
I'm hoping for an equivalent of something like
Bson filter = Filters.and(Filters.gt("cId", valueOf("0")), Filters.lt("cId",valueOf("4")));
Thanks...
cIdto a number within the pipeline using$convertmongodb.com/docs/manual/reference/operator/aggregation/convert and then match it using your parameters