Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-15537

Clarify range query behavior within sort order documentation

    XMLWordPrintableJSON

Details

    Description

      Original description

      Running a range query with null does not yield any results. Whereas the expected result would be that any values but null or undefined should be retrieved, as per the BSON sort order https://www.mongodb.com/docs/v4.4/reference/bson-type-comparison-order/

      Triage addition

      Can we please add a note to the following effect in the introduction of https://www.mongodb.com/docs/v4.4/reference/bson-type-comparison-order/:

      This page describes the behavior of sort operations. Range query and aggregation operators only perform comparisons on fields where the BSON type matches the query value's type. MongoDB supports limited cross-BSON comparison through Type Bracketing.

      (Most of this language is cribbed directly from: https://www.mongodb.com/docs/v4.4/reference/operator/query/gt)

      Attachments

        Activity

          People

            sarah.simpers@mongodb.com Sarah Simpers
            dmitry.ryabtsev@mongodb.com Dmitry Ryabtsev
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              1 year, 26 weeks ago