Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-16027

[Server] Elaborate on $set tracking changed fields on update

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: manual, Server
    • Labels:

      I believe that our documentation on $set should include a section which explains how it doesn't change the fields that don't change in the update, so only ones that changed get written to the oplog. This is a major selling point for using $set and, in my point of view, not obvious that it works like that.

      Advantages over full document replacement:

      • Computes the delta of the existing document and fields in $set
      • Only changes are written to the oplog
      • Smaller memory footprint

      This saves a lot of work for the client intersecting documents to figure out which fields have been changed before sending an update.

            Assignee:
            Unassigned Unassigned
            Reporter:
            ilan.cohen@mongodb.com Ilan Cohen
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              1 year, 4 weeks, 2 days ago