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

can't compare values of BSON types 16 and 18



    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.1.1
    • Labels:
    • Environment:
      Debian 5, Kernel 2.6.26, 32-bit OS.
    • Operating System:


      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.


          Issue Links



              • Votes:
                0 Vote for this issue
                2 Start watching this issue


                • Created: