How to check if relation exist

I have an application where users can like posts. I use relationships when a user decides to like a post like this:
ParseObject postObject = ParseObject(‘Post’);
postObject.addRelation(‘likes’, [ParseObject(‘User’)…set(‘objectId’, ‘000’)]);
await postObject();

and if user dislike:
ParseObject postObject = ParseObject(‘Post’);
postObject.removeRelation(‘likes’, [ParseObject(‘User’)…set(‘objectId’, ‘000’)]);
await postObject();

How do you know if a user has already liked a particular post?

I was using likes as lists before so for each post I just had to do:
if (likes.contains(‘000’)) {
} else {
To know if I should add or remove the user’s like.

How do I do the same using relations so I know if I should use addRelation or removeRelation?