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

Allow readonly arrays

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 4.1.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • 2
    • Not Needed

      What problem are you facing?

      Can't pass Typescript readonly arrays to driver functions (filters, updates, ...).
      But I don't think that the drive will change the arrays so the requested type for arrays should be readonly.

      What driver and relevant dependency versions are you using?

      mongodb@4.0.0

      Steps to reproduce?

      col.findOne({ color:

      { $in: ['blue', 'red'] as readonly string[] }

      })

            Assignee:
            neal.beeken@mongodb.com Neal Beeken
            Reporter:
            js@stairwage.com Jérôme Senot
            Daria Pardue
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: