Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-2460

Consider always encoding $inc value as minimum integer size

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor - P4 Minor - P4
    • 2.0.0
    • None
    • None
    • None
    • Major Change

    Description

      We currently encode someĀ uint Go types (uint, uint32 and uint64) as Int64 in BSON by default. It would probably make more sense to encode them as an Int32 if possible by default. This behavior is controlled by the EncodeToMinSize option on UIntCodec. Interestingly, our mgocompat Registry does have EncodeToMinSize as true by default.

      We cannot change the default behavior without breaking current users' code.

      Open questions:

      • Are there any other operations we should try to encode the minimum size integer, or is it only $inc?

      Attachments

        Activity

          People

            Unassigned Unassigned
            benji.rewis@mongodb.com Benji Rewis (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: