[SOLVED] Cloud functions returning ParseObject and ParseUser but not actual data

I created the following cloud function to get all users

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

When I call this from the client, I just get this “ParseUser” in the response

async function getUser() {
  const users = await Moralis.Cloud.run("getUser");
  console.log(users)
}

Screen Shot 2022-03-12 at 9.37.29 AM

Why am I not seeing the user data?

In attributes is some data. Also, sometimes you can use console.log(JSON.stringify(results)) to see the data. Sometimes you need to use .get

Ah, the data is in attributes. Thanks

1 Like