Skip to content

fix(NODE-6043): Binary.toString and Binary.toJSON output with respect to position #666

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

Merged
merged 2 commits into from
Apr 8, 2024

Conversation

aditi-khare-mongoDB
Copy link
Contributor

@aditi-khare-mongoDB aditi-khare-mongoDB commented Apr 2, 2024

Description

Binary.toString and Binary.toJSON now respect position when printing out binary object.

What is changing?

See release highlights.

Is there new documentation needed for these changes?

No.

What is the motivation for this change?

Bug Fix.

Release Highlight

Binary.toString and Binary.toJSON now respect position when printing out binary object.

When the toString() or toJSON method is called on a Binary instance, it will print out until the instance's position property of the object, instead of the entire buffer.

Example:

new BSON.Binary().toString();
// old output: '\x00\x00\x00\x00...' (256 zeros)
// new output:  ' ' 

Double check the following

  • Ran npm run check:lint script
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@aditi-khare-mongoDB aditi-khare-mongoDB changed the title fix(NODE-6043): binary toString and toJSON output fix(NODE-6043): Binary.toString and Binary.toJSON output with respect to position Apr 2, 2024
@aditi-khare-mongoDB aditi-khare-mongoDB changed the base branch from main to 5.x April 2, 2024 20:03
@aditi-khare-mongoDB aditi-khare-mongoDB marked this pull request as ready for review April 5, 2024 20:22
@W-A-James W-A-James self-requested a review April 5, 2024 21:33
@W-A-James W-A-James self-assigned this Apr 5, 2024
@W-A-James W-A-James added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Apr 5, 2024
Copy link
Contributor

@W-A-James W-A-James left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, test failures unrelated

@W-A-James W-A-James merged commit d6b15f8 into 5.x Apr 8, 2024
3 checks passed
@W-A-James W-A-James deleted the fix-binary-toString-5.x branch April 8, 2024 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Primary Review In Review with primary reviewer, not yet ready for team's eyes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants