[SOLVED] Live Query doesn't return attributes


I was following a guide on Live Queries, so I got working that when a record gets created a function is called.

init = async () => {
  console.log("I have been summoned!");
  let query = new Moralis.Query("KekwTokenEvents");
  let subscription = await query.subscribe();
  subscription.on("create", onTokenMint);

onTokenMint = (token) => {
  try {
    console.log("Minting... Token ID:" + token.attributes.ID);
  } catch (err) {
    console.log("Error Occured: ");

When going into the onTokenMint function and passing the token. I only get the following object returned:


It has no attributes array, while in the database it does have attributes:

How do I get the object with attributes?

For me it looks to give me the attributes for a simple table.
You try here: token.attributes.ID but you have tokenID in that print screen.

1 Like

Ofcourse, what a typo :sweat_smile: I was wondering why should have done token.attributes.tokenID