I want to filter out below data using Ramda. The desired result is to show the properties where usage === 'Defining'
.
const data = [{"attributes": [ {"usage": "Descriptive"}, {"usage": "Defining"} ]}]
So far this is what i have done and it's not filtering out data and returning the whole object.
R.filter( R.compose( R.any(R.propEq('usage', 'Defining')), R.prop('attributes') ))(data)
Below is the desired result that i want to acheive:
[{"attributes": [ {"usage": "Defining"} ]}]