-
Type: Bug
-
Resolution: Fixed
-
Priority: Critical - P2
-
Affects Version/s: None
-
Component/s: BSON
-
Empty show more show less
-
Not Needed
Quoting myself from Slack:
So … as we just discovered in #mongosh, the legacy shell and the driver have the exact opposite ordering of arguments:
https://mongodb.slack.com/archives/CUHC9R8J0/p1627483982391900?thread_ts=1627440319.366000&cid=CUHC9R8J0This is obviously not good – we want to have BSON class definitions in mongosh that are usable in the driver as well, but this kind of undetectable incompatibility with the legacy shell is probably not really acceptable.
I’m thinking that we’d probably rather get this resolved as soon as we can, given that we’re already post-GA. The best way to do that is probably to introduce a new format that the legacy shell does not understand, therefore removing ambiguity. Based on past feedback like on the Long and Decimal128 cases, I think it’s safe to say that people care about terseness a lot, so while we could use Timestamp.fromBits(i, t) here, my gut feeling would be that it makes sense to add a new constructor format, say, Timestamp({ t: 1627479034, i: 1 }) . If we agree that this is okay, we could implement it in mongosh and then add support to the driver BSON class at the same time (but we wouldn’t have to wait for a release).
As durran pointed out, the order of the arguments should also be reversed in the Node.js BSON library, but since this is a breaking change, that is probably not a viable short-term solution here.
- related to
-
MONGOSH-930 Timestamp() argument order is reversed from legacy shell
- Closed