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

Update should provide more than $inc $min $max etc.

    • Type: Icon: New Feature New Feature
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying, Write Ops
    • None
    • Query

      On update you can use functions like $min $max $inc etc. but I think develop applications would be much easier if there were several more.

      e.g.
      $dec: yes you can substract values using $inc with negativ numbers, but that looks not nice, but like a hack. So $dec function to decrement would solve this.

      $avg: I can calc the average of the old and new value just with the aggregation framework or using a count field and divide my value and the count field. There is no chance to do this work on update (min and max use both arguments too. I think it's not hard to implement a mechanism to use some calculation functions on these arguments on update time).

      $div: there is a $mul operator why is there no $div operator to divide numbers?

            Assignee:
            backlog-server-query Backlog - Query Team (Inactive)
            Reporter:
            ChampS Ben [X]
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: