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

Consider always encoding $inc value as minimum integer size

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Major Change
    • None
    • None
    • None
    • None
    • None
    • None

      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?

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

              Created:
              Updated:
              None
              None
              None
              None