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

JavaScript $function in update

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major - P3
    • Resolution: Won't Do
    • None
    • None
    • Write Ops
    • Query

    Description

      For maximum flexibility we should allow running arbitrary javascript code on each object during an update. It should probably run after other modifiers.

      update({_id: "foo"}. {$inc:

      {count: 1, total: 5}

      , $function: function()

      {this.avg = this.total / this.count}

      }

      Attachments

        Issue Links

          Activity

            Dates

              Created:
              Updated:
              Resolved: