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)
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.