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

Consider having mongod autogenerate _id fields for documents inserted into a time-series collection

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution

      If a user inserts a document into MongoDB without an _id field, ordinarily either the client or mongod will automatically generate and add an _id field.

      mongod does not do this for documents inserted to time series collections. This makes sense since the documents aren't stored directly in a collection, but rather in the buckets collection, which has its own autogenerated _id fields.

      However, if a user expects that inserting a document like {a: 1, b: 1} will autogenerate an _id field and insert a document like {_id: ObjectId(...), a: 1, b: 1}, they may be surprised when this doesn't happen for time series collections.

      We should discuss whether or not it's worth having mongod autogenerate _id fields for documents inserted into a time-series collection, and if so, we should maybe also file tickets for drivers which don't implement _id autogeneration.

            Assignee:
            backlog-server-execution [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            matthew.saltz@mongodb.com Matthew Saltz (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated: