Variable as column field when using .set on Cloud Functions

When I use this code in my cloud functions, the value is never set on the database:

const userEthAddr = await request.user.get("ethAddress");
const GameState = Moralis.Object.extend("GameStates");
const gameState = new GameState();
gameState.set (userEthAddr, {"id": userEthAddr, "ready": false})
await ()

Can anyone help me with this issue? Any tips would be greatly appreciated!

I don’t think you need userEthAddr as the input for .set there, just have the JSOn you want to save would be sufficient :raised_hands:

1 Like

Hey give this a shot:


1 Like