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

Provide an example of comparison semantics

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor - P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: manual, Server
    • Labels:

      Description

      In http://docs.mongodb.org/manual/reference/bson-types/ it would be a lot easier for me to understand this statement if you gave an example, like 1 != "1"

      "When comparing values of different BSON types, MongoDB uses the following comparison order, from lowest to highest"

      Also, I think the docs at http://docs.mongodb.org/manual/reference/bson-types/ should be more specific about the following. I assume this is a statement about the BSON numeric types (32-bit int, 64-bit int, double) because JSON doesn't have a choice. I think a few sentences would be sufficient to explain the precedence. Is it int32 -> int64 -> double?

      "MongoDB treats some types as equivalent for comparison purposes. For instance, numeric types undergo conversion before comparison."

        Attachments

          Activity

            People

            Assignee:
            kay.kim Kay Kim (Inactive)
            Reporter:
            mdcallag Mark Callaghan
            Participants:
            Last commenter:
            Kay Kim Kay Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Days since reply:
              6 years, 45 weeks, 3 days ago