Skip to content

Dot notation operations are stored as the literal operation object on Postgres instead of being applied #10828

Open

Description

@mtrezza

New Issue Checklist

Issue Description

On Postgres, a create or update that applies certain dot notation operations to a nested field stores the raw operation object, for example {"__op": "Add", "objects": ["b"]}, into that field instead of applying the operation. The save response and every later read then return the operation object in place of the real value, so the stored data is corrupted for all callers. MongoDB applies the operations correctly.

Affected on Postgres:

  • Add, AddUnique and Remove on a one-level nested array field, for example stats.list.
  • Increment nested two or more levels deep, for example stats.deep.n. A single-level Increment such as stats.views is applied correctly.

In addition, sibling keys under the corrupted parent can be lost: updating stats.deep.n drops stats.deep.m.

Steps to reproduce

Uses the master key.

  1. Nested array operation:
    • POST /classes/Thing with body {"stats": {"list": ["a"]}}
    • PUT /classes/Thing/<objectId> with body {"stats.list": {"__op": "Add", "objects": ["b"]}}
    • GET /classes/Thing/<objectId>
  2. Deeply nested Increment:
    • POST /classes/Thing with body {"stats": {"deep": {"n": 1, "m": 2}}}
    • PUT /classes/Thing/<objectId> with body {"stats.deep.n": {"__op": "Increment", "amount": 1}}
    • GET /classes/Thing/<objectId>

Actual Outcome

  1. stats.list is {"__op": "Add", "objects": ["b"]} instead of ["a", "b"]. The same happens for AddUnique and for Remove (a Remove on an absent parent also stores the literal operation object).
  2. stats.deep is {"n": {"__op": "Increment", "amount": 1}} instead of {"n": 2, "m": 2}: n holds the operation object and the sibling m is lost.

Expected Outcome

The operation is applied to the nested value, so stats.list is ["a", "b"] and stats.deep is {"n": 2, "m": 2}, as on MongoDB.

Environment

Server

  • Parse Server version: 9.10.7-alpha.1
  • Operating system: macOS
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): local

Database

  • System (MongoDB or Postgres): Postgres (MongoDB not affected)
  • Database version: 16 with PostGIS 3.5
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): local

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): REST API
  • SDK version: n/a

Logs

None; no error is raised.

Activity

  1. parse-github-assistant commented on Oct 23, 2026

    @parse-github-assistant

    🚀 Thanks for opening this issue!

    ℹ️ You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

  2. mtrezza commented on Oct 23, 2026

    @mtrezza
    MemberAuthor

    Related: #10827 — on MongoDB the same dot notation operations instead return HTTP 500 when the resulting field is absent from the write result. Different root cause, tracked separately.

  3. changed the title [-]Dot notation Add, AddUnique and Remove are stored as the literal operation object on Postgres[/-] [+]Dot notation operations are stored as the literal operation object on Postgres instead of being applied[/+] on Oct 23, 2026
  4. mtrezza commented on Oct 23, 2026

    @mtrezza
    MemberAuthor

    Correction: this is broader than the original title. Beyond Add/AddUnique/Remove on a one-level nested array, a nested Increment two or more levels deep (e.g. stats.deep.n) is also stored literally and drops sibling keys under the parent. A single-level Increment (stats.views) is applied correctly. Title and description updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions