Skip to content

ParseObject.clone() not copying object id #501

Closed
@jaeggerr

Description

@jaeggerr

I am not sure if this is a bug or the expected behaviour, but I think that the clone method of ParseObjet should return an identical object and thus copy the object id.
http://parseplatform.org/Parse-SDK-JS/api/classes/Parse.Object.html#methods_clone
Other attributes seem to be correctly copied but the object id is missing.

async function testClone () {
  let myObject = new MyObject()
  myObject = await myObject.save()
  console.log(myObject.id)  // Returns an id
  myObject = myObject.clone()
  console.log(myObject.id)  // id is now undefined
}

I am using Parse 1.10.1 with Postgres.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:docsOnly change in the docs or READMEtype:questionSupport or code-level question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions