[SOLVED] Get data by Pointer

I canā€™t figure out how to query data by pointer.
For example I have an Offer
so Object Offer has Account, Description, array Ids, and Pointer to user object.

How I can build useMoralisQuery to get all Offers by UserId(Pointer)

Hi Akira, as usual - I asked myself, I answered myself
The solution I was looking for is -
const { fetch } = useMoralisQuery(
ā€œTABLENAMEā€,
(query) =>
query
.equalTo(ā€œuserIdā€, {
__type: ā€œPointerā€,
className: ā€œ_Userā€,
objectId: ā€œUserIdFromUserTableā€,
})
.select(ā€œAccountā€, ā€œDescriptionā€, ā€œIdsā€),
[],
{ autoFetch: false },
);

Correct me if I am wrong, but it looks good for me.

2 Likes