[GODRIVER-2460] Consider always encoding $inc value as minimum integer size Created: 15/Jun/22  Updated: 08/Jan/24

Status: Backlog
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 2.0.0

Type: Bug Priority: Minor - P4
Reporter: Benji Rewis (Inactive) Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: Go Driver 2.0: Driver
Case:
Backwards Compatibility: 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?

Generated at Thu Feb 08 08:38:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.