Not able to read all fields of a record returned in a query

I’m getting a weird issue - When I’m running a query on a collection, I’m getting back the record but it only contains a couple of fields and not all fields. The record that i get just contains id, _objCount and className. It does not return the custom fields that I had set. The data is definitely present in the database but it’s just not being returned in the query.

I haven’t put any ACL / security restrictions yet and this is just the default.

This is the code for setting the data:

const UserPublicInfo = Moralis.Object.extend("UserPublicInfo");
const userPublicInfo = new UserPublicInfo();
userPublicInfo.set('ethAddress', currentUser.get('ethAddress'));
userPublicInfo.set('user', currentUser);;

This is working as expected and the data is being saved. But getting back the data in a query is not working for some reason.

Do you use .get() to ask for fields?

Ahh you’re right. I was looking for the attributes straight from the data. .get() worked. Thanks!

1 Like