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

$slice projection returns all fields

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Works as Designed
    • Affects Version/s: 1.8.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Operating System:
      ALL

      Description

      db.foo.save(

      {a: 1, b: [1, 2, 3]}

      )

      db.foo.find({}, {b: {$slice: [1, 2]}})

      { "_id" : ObjectId("4e146daea715701bb7716a85"), "a" : 1, "b" : [ 2, 3 ] }

      Why does this return the 'a' field too?

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              redbeard0531 Mathias Stearn
              Reporter:
              kbanker Kyle Banker
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: