Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-1124

to_bson_int64 methods should convert all fixnum to bson_int64

    • Type: Icon: New Feature New Feature
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • bson-4.2.0
    • Affects Version/s: None
    • Component/s: BSON
    • None
    • Environment:
      Windows

      1.Try convert some fixnum number directly to bson_int64
      require 'bson'
      s=102.to_bson_int64(102)
      2.Check s.bson_type

      Actual: It returns '\x10'.

      Expected: Since the method is called to_bson_int64 - it should work as it names and set the bson_type to '\x12'. In my particular case, our dev guys wrote their own c++ bson parser and for some number values always expect to have bson_int64on server. So far I have to use extremely big numbers for those values, but it looks ugly.

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            ipevtsov Ivan Pevtsov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: