$slice projection returns all fields

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • None
    • Affects Version/s: 1.8.2
    • Component/s: None
    • None
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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?

            Assignee:
            Mathias Stearn
            Reporter:
            Kyle Banker (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: