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

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

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • manual, Server

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              43 weeks, 1 day ago