-
Type: Investigation
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Tools and Replicator
-
51
Collection and view creation changestream events will now contain an additional field "operationDescription.type" with the type of the collection/view created.
The new `type` field is placed inside the existing `operationDescription` object, so that the top-level fields for events do not change.
The value for the `operationDescription.type` field is determined as follows:
- if the original oplog entry is a "create" (collection) entry, then `operationDescription.type` will contain `collection`.
- if the original oplog entry is a command that creates a timeseries collection with "viewOn" starting with `system.buckets.`), then `operationDescription.type` will contain `timeseries`.
- if the original oplog entry is a command that creates a non-timeseries view (with "viewOn" being set but not starting with `system.buckets.`), then `operationDescription.type` will contain `view`.
The new `operationDescription.type` field will only be returned if the changestream was opened with the `showExpandedEvents` flag.
Description of Linked Ticket
Currently `create` events offer no explicit indication of the type of the namespace that’s been created. Clients have to parse it heuristically:
- If there’s a collection UUID: type=collection.
- Otherwise, if viewOn is a system.buckets collection: type=timeseries.
- Otherwise, type=view.
This means clients have to know about all collection types. So were there to be some new collection type, the logic above would process it as a view. Moreover, a client that doesn’t want to care about time-series collections nonetheless has to filter them out explicitly.
It would seem better all around to add a “type” field to the event.
- depends on
-
SERVER-88142 Include collection type with `create` events.
- Closed