How to use matchesQueery

Hello

I have two related classes. One is the user class and the other is a class where the user operation takes place. There are user endpoints in the class where the operation takes place. When I pull the transactions, I want the user data to come.

For this, I have tried querying for each user objectId before, but it is a very long process. How can I simply handle this? Can you help with how to do this with “query.matchesQuery”?

You need to create a relationship between the two classes. Once the relationship is added you can query user operation through relation.query() that gives you the user related data from the user operation class.

Check the below docs for examples:
https://docs.moralis.io/moralis-dapp/database/objects#many-to-many-relationships

Do I need to establish this relationship every time?

When you create a new row in user operation you need to link it to some user in the user class, before the save function.
So yeah, it needs to be done for every new row.