Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-4102

Add $nop operation to modifier

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Usability, Write Ops

      Although it can be worked around, it can be problematic that when an empty modifier object is used with findAndModify it removes all properties of the document. We suggest adding a no-op modifier operation, $nop, which makes no change to the document. This can therefore be added to all modifier operations and will ensure that previously empty ones will not wipe out the document:

      Usage:
      { $nop: {} }

            Assignee:
            Unassigned Unassigned
            Reporter:
            richardms Richard Miller-Smith
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: