Get user with certain eth Address

I am simply trying to query a user with a certain eth address. How can I do this? Here is my code in a cloud function that I am running on the frontend to get the user:

Moralis.Cloud.define(‘getUserWithAddress’, async (request) => {
const query = new Moralis.Query(‘User’)
query.equalTo(‘ethAddress’, request.params.address)
const result = await query.find({ useMasterKey: true })

return result 


Running getUserWithAddress gets me an undefined response

try with a hardcoded value first, or logging that request.params.address to see if it has the right parameter

as an idea is should work what you are trying to do there

Alright yeah I figured it out, thank you. But it does say that the user cannot be modified. Is this because I must do it in a cloud function and use master key?

If you’re trying to modify another user, you can do that from the cloud function with master key. Nonetheless a logged in user can modify his data