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

Add $nop operation to modifier

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Works as Designed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Usability, Write Ops
    • Labels:

      Description

      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: {} }

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: