-
Notifications
You must be signed in to change notification settings - Fork 84
feat(service-provider-core): support new BSON vector types in mongosh MONGOSH-1873 #2425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
084e52c to
d93774d
Compare
| depth, | ||
| ...options, | ||
| // These arrays can be very large, so would prefer to use the default options instead. | ||
| maxArrayLength: utilInspect.defaultOptions.maxArrayLength, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if we want this, could remove. it just seems possible that these arrays can be very large I'd imagine so the {maxArrayLength: Infinity} that we're getting from
| return formatCursor(value, { ...options, ...fullDepthInspectOptions }); |
| ) | ||
| ).matches( | ||
| // Precision is lost because of float handling, so we use regex to match | ||
| /Binary.fromFloat32Array\(new Float32Array\(\[ 1\.1\d*, 2\.2\d*, 3\.3\d* \]\)\)/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if we're meant to be dealing with float precision weirdness in JS in this case. can definitely see how it'd be weird to see imprecise floats while trying to inspect data. we could do something like https://github.com/mongodb-js/compass/pull/6834/files#diff-3d4b298fbb2cfe42467edc59277483eb9bcfdc46b07ea658ab3dc4f66903da88R174
89ba28e to
ad3efe5
Compare
addaleax
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great! 🚀
| return binaryInspect.apply(this, args); | ||
| } | ||
| }, | ||
| } satisfies CustomInspectFunction, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💙
85d942b to
93b6028
Compare
93b6028 to
8d7c10e
Compare
Add friendlier support for displaying BSON binary vector types in mongosh by displaying them as reproducable Binary constructor calls.
