Skip to content

'array' type column is updated even without an explicit 'set' #8534

@refre5h

Description

@refre5h

New Issue Checklist

Issue Description

It seems that Parse recognizes changes in the 'array' column and will save the changes even without an explicit 'set'.

Steps to reproduce

const files = object.get('files'); // files is an array
files[0].aa = 'bb';
console.log(object.dirtyKeys()); // ==> ['files']

object.set('anotherCol', someVal);
object.save(); // the object's 'anotherCol' and 'files' columns are both updated.

Actual Outcome

'files' is a dirty key and is updated upon .save() even without an explicit 'set'.

Expected Outcome

'files' is not a dirty key unless user 'set' the change like: object.set('files', value)

Environment

Server

  • Parse Server version: 5.2.0
  • Operating system: Amazon Linux 2
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): AWS

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: 5.0.17
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): MongoDB Atlas,

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): JavaScript
  • SDK version: 3.4.0

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:featureNew feature or improvement of existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions