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

Excluding _id field doesn't work with FindAndModify

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 1.9.1
    • Write Ops
    • None
    • Windows 7 64
    • ALL

    Description

      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"

      Attachments

        Issue Links

          Activity

            People

              mathias@mongodb.com Mathias Stearn
              alexjamesbrown Alex Brown
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: