Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-281

PopFirst and PopLast do the opposite jobs

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 1.2
    • 1.1
    • None
    • None
    • Major Change

    Description

      Here is the PowerShell script that shows the bug:
      (on the other hand, it is not even needed, just double check the driver code of these methods)

      Add-Type -Path MongoDB.Driver.dll

      1. DOCS: http://www.mongodb.org/display/DOCS/Updating
      1. Output:
        Unknown macro: { "$pop" }
      2. Expected, see DOCS:
        Unknown macro: { $pop }

        $PopFirst = [MongoDB.Driver.Builders.Update]::PopFirst("name")
        $PopFirst.ToString()

      1. Output:
        Unknown macro: { "$pop" }
      2. Expected, see DOCS:
        Unknown macro: { $pop }

        $PopLast = [MongoDB.Driver.Builders.Update]::PopLast("name")
        $PopLast.ToString()

      Note: I have also tried some real example but the code is not so easy to share. Yes, these function do the opposite job, as if their bodies are swapped by mistake.

      Attachments

        Activity

          People

            robert@mongodb.com Robert Stam
            nightroman Roman Kuzmin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: