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

PopFirst and PopLast do the opposite jobs

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.2
    • Affects Version/s: 1.1
    • Component/s: None
    • None
    • Major Change

      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.

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

              Created:
              Updated:
              Resolved: