I have JSON data array of
[
{
_id: 5f2084f656dc2428e96fbe92,
category: [ '5e5150c6c52a3904b74d6ff7', null ],
coordinates: { lat: 37.8025909, lng: -122.4336412 },
location: { type: 'Point', coordinates: [Array] },
calcDistance: 3323.833296768243
},
{
_id: 5f2084fb56dc2428e9703f3b,
category: [ '5e5150bcc52a3904b74d6ff6', null ],
coordinates: { lat: 37.7683708, lng: -122.4564649 },
location: { type: 'Point', coordinates: [Array] },
calcDistance: 3340.838606150309
},
{
_id: 5f2084f656dc2428e96fbe86,
category: [ '5e5150c6c52a3904b74d6ff7', null ],
coordinates: { lat: 37.7669182, lng: -122.4561008 },
location: { type: 'Point', coordinates: [Array] },
calcDistance: 3349.000719541262
},
{
_id: 5f2084fb56dc2428e9703f3f,
category: [ '5e5150bcc52a3904b74d6ff6', null ],
coordinates: { lat: 37.7669182, lng: -122.4561008 },
location: { type: 'Point', coordinates: [Array] },
calcDistance: 3349.000719541262
},
{
_id: 5f2084fa56dc2428e9702130,
category: [ '5e5150bcc52a3904b74d6ff6', null ],
coordinates: { lat: 37.7669182, lng: -122.4561008 },
location: { type: 'Point', coordinates: [Array] },
calcDistance: 3349.000719541262
},
{
_id: 5f2084fb56dc2428e9703ee5,
category: [ '5e5150bcc52a3904b74d6ff6', null ],
coordinates: { lat: 37.7787325, lng: -122.4572683 },
location: { type: 'Point', coordinates: [Array] },
calcDistance: 3357.3418413767595
},
{
_id: 5f2084f856dc2428e96ff091,
category: [ '5e5150bcc52a3904b74d6ff6', null ],
coordinates: { lat: 37.8049528, lng: -122.4249378 },
location: { type: 'Point', coordinates: [Array] },
calcDistance: 3377.281713590449
},
{
_id: 5f2084fb56dc2428e9703f73,
category: [ '5e5150bcc52a3904b74d6ff6', null ],
coordinates: { lat: 37.8049528, lng: -122.4249378 },
location: { type: 'Point', coordinates: [Array] },
calcDistance: 3377.281713590449
},
{
_id: 5f2084fb56dc2428e9703f39,
category: [ '5e5150bcc52a3904b74d6ff6', null ],
coordinates: { lat: 37.7788351, lng: -122.4575644 },
location: { type: 'Point', coordinates: [Array] },
calcDistance: 3384.6341862170793
},
{
_id: 5f14aa92745456119cf27701,
category: [ '5e5150f0c52a3904b74d6ffb', null ],
coordinates: { lat: 37.779187, lng: -122.4577491 },
location: { type: 'Point', coordinates: [Array] },
calcDistance: 3405.9730381738473
},
{
_id: 5f2084fb56dc2428e9703f21,
category: [ '5e5150bcc52a3904b74d6ff6', null ],
coordinates: { lat: 37.8034776, lng: -122.4027084 },
location: { type: 'Point', coordinates: [Array] },
calcDistance: 3501.3565554464535
},
]
I want to find an object that has a category on of 'favTypes' that returns
"5e5150bcc52a3904b74d6ff6,5e5150c6c52a3904b74d6ff7,5e5150d6c52a3904b74d6ff8"
Searching objects that have one of this three object_Id in their category. I have tried
jsondatas.filter(jsondata => word.category = favTypes);
However, it is returning the jsondatas not filtered objects. Is there any way that I can filter