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

Audit function overrides for complete definitions – db.watch() and client.watch()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 4.0.0
    • Fix Version/s: 4.0.0
    • Component/s: Shell
    • Labels:
      None
    • Documentation Changes:
      Not Needed

      Description

      The original ticket in NODE-2934 addressed this for coll.watch(), but not db.watch() or mongoClient.watch().

      In Typescript when listing the function overrides you have to enumerate all possible usages, seperate from the actual function signature. For example:

      watch(): ChangeStream;
      watch(pipeline?: Document[]): ChangeStream;
      watch(pipeline?: Document[], options?: ChangeStreamOptions): ChangeStream {/* ... */}
      

      Since there is no override that accepts options, options is not exposed as a parameter to the user of this function. This is also a case where no override is necessary. We should scan through our usage of overrides and make sure we have used it correctly and completely.

      Helpful regex: \1 references the first capture group!

      ^\s*(\w+)\(.*\).+;\n\s+\1

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              daria.pardue Daria Pardue
              Reporter:
              anna.henningsen Anna Henningsen
              Implementer:
              Neal Beeken Neal Beeken
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: