parse-community / parse-community/parse-server

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

Open
#8,534 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:feature
Dominant language
JavaScript
Stars
21.4k
Forks
4.8k
Avg merge
7h 45m
Merged PRs (30d)
11

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the case with the JavaScript SDK against Parse Server 5.2.0 and MongoDB 5.0.17, starting from the dirtyKeys() and save() entry points shown in the report. Trace how an in-place array mutation becomes dirty, then verify that changing anotherCol alone no longer updates files unless it is explicitly set.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mongodb, nodejs
Domain
api, backend, database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.