Object not found error when saving new object with SDK

Been using moralis for a few months, absolutely love it. But running into one of my first issues that iā€™m stuck on, i feel like itā€™s something super small that iā€™m missing, but basically my const newUser = await userProfile.save line is triggering the catch and giving me an ā€œobject not foundā€ error. that said i am able to successfully log my userProfile in the line directly above it and can verify that both username and objectId exist. So not quite sure why itā€™s failingā€¦ side note for context, iā€™m creating these rows in a userProfile class so can later add discordID, profilePic, shares in DAO, etcā€¦ thanks any help greatly appreciated it, striking out on discord.

    const username = user.username
    const objectId = user.objectId
    console.log("CREATING", username, objectId)
    const UserProfile = Moralis.Object.extend('UserProfile');
    const userProfile = new UserProfile()
    console.log('USER PROFILE', userProfile)
    try {
      const newUser = await userProfile.save({
        username: username,
        objectId: objectId
      })
      return newUser
    } catch(e) {
      console.log('ERROR CREATinG', e.message)
    }

you may want to use a different field name for objectId, you can also search on google how to do it with parse server, as parse server is used by Moralis Server

you could also try the syntax with userProfile.set(

Sweet. yeah, that was the problem. Dumb mistake, forgot that each class has an objectId.