I have a mongoDb collection with following data:
{
"material_name": "david",
"material_unit": "87",
"version": "1.0"
}
I am using following query field filter to fetch all material related fields which is working alright.
Query query = new Query();
query.fields().include("material_name");
query.fields().include("material_unit");
I have almost 100+ fields names which start with material. Is it possible to query fields with some kind of regex or any alternative approach?.
E.g.
Query query = new Query();
query.fields().include("material*");