Consider always encoding $inc value as minimum integer size

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: 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
            Reporter:
            Benji Rewis (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: