Excluding _id field doesn't work with FindAndModify

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 1.9.1
    • Affects Version/s: None
    • Component/s: Write Ops
    • None
    • Environment:
      Windows 7 64
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      If I have the following document:

      db.sequence.findAndModify({
      query:

      {"_id": "customer"}

      ,
      update : {$inc : {"seq":1}},
      fields:

      {"_id":0}

      ,
      upsert:true,
      new:true})

      Notice the fields:

      {"_id":0}

      , part-
      According to the documentation, this should prevent the id from being returned, however when I try and execute this command, I get this error:

      Uncaught exception: findAndModifyFailed failed: "exception: assertion c:\\builds\laves\\mongo\\windows_64bit_v1.6\\mongo\\db
      ../bson/bsonbjbuilder.h:115"

              Assignee:
              Mathias Stearn
              Reporter:
              Alex Brown
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: