“containedIn” returns nothing if I used it with pointer type

I f I try to filter the data by using containedIn as below I will be getting empty result because I’m trying to filter from pointer column type userProfile despite that I include the userProfile in the query.

However, I tried to use containedIn directly to another array column in User and seems it was working fine. is this kind of the below queries will not work? and what could be the alternative solutions?

const query = new Parse.Query('User');
query.equalTo('accountType', 'Student');

// search.subjects is an array

query.containedIn(‘userProfile.subjectsIds’, search.subjects);

It is not possible to apply a constraint to a pointer’s field. You can use matchesQuery (JavaScript Developers Guide | Parse) or aggregate (JavaScript Developers Guide | Parse).