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

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Works as Designed
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Write Ops
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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 (Inactive)
            Reporter:
            yi ba
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: