Skip to content

ExecuteUpdate: support partial updating inside JSON documents #28766

Open

Description

ctx.blogs.ExecuteUpdate(s => s.SetProperty(b => b.SomeJsonDocument.Foo, b => "foo");

Things get interesting when there are multiple updates inside the same JSON document:

ctx.blogs.ExecuteUpdate(s => s
    .SetProperty(b => b.SomeJsonDocument.Foo, b => "foo")
    .SetProperty(b => b.SomeJsonDocument.Bar, b => "bar");

We could apply the same logic we're discussing for SaveChanges:

  1. Do "least-common-denominator" to find the smallest branch containing all the properties to be updated.
  2. As a further optimization, nest multiple invocations (e.g. of JSON_MODIFY for SQL Server) to update the two properties; but we need to investigate and benchmark to know to what extent that makes sense and when.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions