Skip to content

[Feature]: Embedded partial updates #1173

@dvlalex

Description

@dvlalex

Is your feature request related to a problem? Please describe.
I'm not sure if this is a feature of a bug, but I've noticed when updating an object embeddable, the queries resets the entire thing.

Describe the solution you'd like
Since using object embedded properties is allowed on mongo/mysql/postgresql only, they all have the option to partially update an object/json type. Might be better for larger embeddables to instead do the updates on the changed properties only.

Additional context
This is how a query looks for an embeddable with object: false
[query] db.getCollection('profile').updateMany({ _id: ObjectId('5fcdf987008a1d1fa3dc6c7e') }, { '$set': { cat_name: 'new name' } }, { session: undefined }); [took 5 ms]

And this is for an object: true
[query] db.getCollection('profile').updateMany({ _id: ObjectId('5fcdf9b09b9b60205fd56db7') }, { '$set': { cat: { type: 0, name: 'new name', canMeow: true } } }, { session: undefined }); [took 3 ms]

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions