I would like to flatten this object without flattening the keys $gt and $lt
{
values:{
gross_floor_area:{"$gt":200, "$lt":5000},
nested: {net_floor_area:{"$gt":200, "$lt":5000}}
}}
the desired result would be
{ 'values.gross_floor_area': { '$gt': 200, '$lt': 5000 },'values.nested.net_floor_area':{"$gt":200, "$lt":5000} }
I have tried using flat library by specifying maxDepth of 2 but only works for gross_floor_area key