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

    • Type: Icon: New Feature New Feature
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Write Ops
    • Labels:
      None

      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' .

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

              Created:
              Updated:
              Resolved: