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

Investigate NODE-3681 - Typescript complains that $currentDate is used with type boolean instead of type 'Date | Timestamp'

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • 1
    • None
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      NODE-3681 Description

      What problem are you facing?

      Typescript complains when using $currentDate with findOneAndUpdate.

       

       

      Hovering _update gives the following error.

       

      And here is the type declaration

       

       

      MongoDB v.4.4 documentation supports boolean for $currentDate while other references mention that it it not supported anymore:

      https://docs.mongodb.com/v4.4/reference/operator/update/currentDate/

      https://github.com/mongodb/docs/commit/55057e64f8c8112be35560ee8d6e603baec414a3

       

      The Node.js Driver v.4.1 support also boolean

      https://mongodb.github.io/node-mongodb-native/4.1/modules.html#UpdateFilter

       

      What driver and relevant dependency versions are you using?

      • MongoDB: v4.4.0
        Typescript: 4.2.3
        Mongodb Node.js Driver: 4.1.3

            Assignee:
            grace.chong@mongodb.com Grace Chong (Inactive)
            Reporter:
            dbeng-pm-bot TPM Jira Automations Bot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              None
              None
              None
              None