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.