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

Silent failure when inserting mongo object with an object field as the _id

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Operating System:
      ALL

      Description

      I accidentally inserted documents in the database with an object as the _id field. I noticed this person reported a similar problem a few years ago: http://stackoverflow.com/questions/24618380/mongodb-inserts-silently-fail

      If I try to do a find all query {}, I can't find the object inserted, but no error was returned. I'm on Mongo 3.0.

      When an index sees a non-object-id object in the indexed field, does it just skip over it rather than erroring? Even if this was the case, I'd expect to find the object when searching with an empty query.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: