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

Document type bracketing

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • Affects Version/s: None
    • Component/s: Server
    • Labels:
      None

      A query like {_id: {$gt: 2}} doesn't mean to find all documents with an _id field that compares greater than the number 2. Instead, it means to field documents where the _id field is a number that compares greater than 2. This implicit restriction of comparison predicates to a particular canonical type is called "type bracketing". If we don't have explicit documentation for this behavior already, then we should add some.

      See SERVER-22308 for an example of how this could cause confusion.

            Assignee:
            steve.renaker@mongodb.com Steve Renaker (Inactive)
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              8 years, 5 weeks, 1 day ago