Skip to content

Incrementing embedded object property stopped working in 4.10.1+ #7653

@MobileVet

Description

@MobileVet

New Issue Checklist

Issue Description

Prior to version 4.10.1, one could increment an embedded object

Steps to Reproduce

const obj = new Parse.Object('TestObject', { doc: { a: 0 } })
obj.increment('doc.a')
obj.save()

Actual Outcome

However, after installing 4.10.1+, the save throws the following error:

Error: key doc.a must not contain '.'
....parse/lib/node/ParseObject.js:3137:35

It also isn't entirely clear where this error is being thrown from, the Server or the JS SDK.

Expected Outcome

Embedded document is incremented

Environment

Server

  • Parse Server version: 4.10.0 and 4.10.1-4
  • Operating system: Mac OS 11.6, Ubuntu 20
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Local & Heroku

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: 4.4.10
  • 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: JS 2.19.0 & 3.3.0

Logs

This PR removed some tests around embedded object incrementing as it indicated this wasn't supported by the server which is why we posted this bug report here and not in the JS SDK repo.

It actually has been supported... so I am a little confused by what this was trying to achieve. The included JS SDK 2.19.0 allowed this and all versions of the JS SDK include unit tests that appear to support embedded document increment.

I understood that @dplewis added embedded document incrementing a while back and we were really excited by that functionality since it is supported by Mongo and was working just fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: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