Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-5209

can't compare values of BSON types 16 and 18

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.1.1
    • Affects Version/s: 2.1.0
    • None
    • Environment:
      Debian 5, Kernel 2.6.26, 32-bit OS.
    • Linux

      When testing the aggregation framework, tried to group by a field that has been previously stored as both 64-bit and 32-bit numbers, depending on the number.

      Running the aggregation query results in a code 16016, or "exception: can't compare values of BSON types 16 and 18"

      Running the old db.collection.group query still works as intended.

      Heavily simplified versions of the aggregation framework query (not working) and the original collection.group query (working) are attached. In both of these queries, it is understood that the field 'ip1' may contain either a 32-bit number (BSON type 16) or a 64-bit number (type 18) I would expect both queries to return groupings based on the field 'ip1'.

      A probable work-around (implementing this currently) is to somehow ensure that all data is written as a 64-bit number, so that all comparisons are between like types, but this seems like something that a green mongo user might find cumbersome to have to understand and deal with.

      New to the bug-fix cycle, and to mongodb in general-- let me know if there's more information I can provide.

        1. aggregationGroupBy.txt
          0.6 kB
          Tim Garvin

            Assignee:
            cwestin Chris Westin
            Reporter:
            tcgarvin Tim Garvin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: