Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-960

Allow filter to be an Optional argument

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • None
    • CRUD
    • None

    Description

      Right now, the crud spec defines the method signature for find as the following:

      find(filter: Document, options: Optional<FindOptions>): Iterable<Document> 

      which implies that filter cannot be Optional<Document>.

      Would it be acceptable for drivers to accept this filter as an optional so that users won't have to specify the empty document when they want to match all documents? Or is this distinction intentional?

      As sam.rossi points out, there already is precedent for this in several drivers (e.g. Java via overloading, Python via accepting None).

      Attachments

        Activity

          People

            Unassigned Unassigned
            patrick.freed@mongodb.com Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: