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

JavaScript $function in update

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Do
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Write Ops
    • Labels:
    • Case:

      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: