Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-4060

Investigate NODE-4059 - ChangeStreamDocument not fully typed to specification.

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • 1
    • Not Needed

      NODE-4059 Description

      Good day,

      according to MongoDB's offical change-events documetation, there are some fields missing in the NodeJS driver interface ChangeStreamDocument.

      Change stream events reference:

      https://docs.mongodb.com/manual/reference/change-events/

      ChangeStreamDocument reference:

      https://github.com/mongodb/node-mongodb-native/blob/33a6fedacacf7ebd7fb52fdb6e35ef3f31a16ea2/src/change_stream.ts#L136

      As you can see, something like the key "to" which is sent by MongoDB when a collection is renamed, is not present in the interface of the driver. As you can see at the following link, it is only present for "rename" events, and should therefore be typed like ns just as optional. (to?: { … })
      https://docs.mongodb.com/manual/reference/change-events/#rename-event

      Additionally clusterTime, txnNumber and lsid also do not have any types.

      Thank you for your time and I hope this gets fixed with the next patch/release.

       

            Assignee:
            durran.jordan@mongodb.com Durran Jordan
            Reporter:
            dbeng-pm-bot PM Bot
            Durran Jordan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: