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

document not inserted properly - a populated ObjectId field is inserted as is, instead of as ObjectId

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Write Ops
    • None

    Description

      reconstruct:

      bulk.insert({ field1: 'abc', field2: { _id: 'someid', value: 'someval' } });
      

      Where field2 is of type ObjectId, and references another table, where 'someid' is the OID of some entry with a single key 'value' with value 'someval' . The collection model corresponds to that.

      Expected result:
      A new entry in the collection, with field2 as an OID .

      Actual result:
      A new entry was created in the collection, but the field2 was created as an object with 2 fields, '_id' and 'value' .

      Attachments

        Activity

          People

            mark.agarunov Mark Agarunov
            yinonby yi ba
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: