How should I get a user's information through ethAddress

Here is my cloud function.

 Moralis.Cloud.define("getAllUser", async (request) => {
  const query = new Moralis.Query("User");
  query.equalTo("ethAddress",request.params.ethAddress)
  const results = await query.find({ useMasterKey: true });
  return results;
});

Your cloud function is correct. You can get the user data by calling this cloud function.
await Moralis.Cloud.run("getAllUser",{ ethAddress: "0x...." })

And make sure to add the wallet address in LowerCase, as the database stores all the wallet addresses in lower case.

1 Like

Yes, it works, thanks big guy.