Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-239

SaveOne and SaveMany added to CRUD Spec

    • Type: Icon: Task Task
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Component/s: None
    • Labels:
      None
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      PERL-544 Won't Fix
      CSHARP-1336 Won't Fix
      $i18n.getText("admin.common.words.show")
      #scriptField, #scriptField *{ border: 1px solid black; } #scriptField{ border-collapse: collapse; } #scriptField td { text-align: center; /* Center-align text in table cells */ } #scriptField td.key { text-align: left; /* Left-align text in the Key column */ } #scriptField a { text-decoration: none; /* Remove underlines from links */ border: none; /* Remove border from links */ } /* Add green background color to cells with FixVersion */ #scriptField td.hasFixVersion { background-color: #00FF00; /* Green color code */ } /* Center-align the first row headers */ #scriptField th { text-align: center; } Key Status/Resolution FixVersion PERL-544 Won't Fix CSHARP-1336 Won't Fix

      The CRUD specification has added saveOne and saveMany to aid users in performing idempotent saves. Previously, users were required to do a replaceOne with an upsert. While this was doable, it was annoying to specify when this is such a common scenario.

      There is a difference in implementation for drivers that mutate documents vs. those that do not. In the former case, if a document is "saved" without an identifer, the driver will generate one just like it does for insert. However, drivers that do not mutate will reject the save with an error or exception. This is due to the requirement for this operation to be idempotent. The details are spelled out in the spec.

      Yaml/JSON tests have been added.

            Assignee:
            craig.wilson@mongodb.com Craig Wilson
            Reporter:
            craig.wilson@mongodb.com Craig Wilson
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: