-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Description
New Issue Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
- I can reproduce the issue with the latest version of Parse Server.
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.