Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

feat!: Support JS BSON v4 #67

Merged
merged 3 commits into from
May 20, 2021
Merged

feat!: Support JS BSON v4 #67

merged 3 commits into from
May 20, 2021

Conversation

nbbeeken
Copy link
Collaborator

@nbbeeken nbbeeken commented May 17, 2021

Syncing the BSON-EXT library with the 4.0 version of our bson library required:

  • Changing the names of the properties of the Long class from low_ and high_ to low and high
  • Update the name of the Symbol class to BSONSymbol
  • Adding the newer ObjectId spelling for the oid class.

Additionally we are able to do some major version changes which seem natural:

  • The BSON library now initializes itself, exporting the types and functions in the same exact way that js BSON does.
  • Sync the node supported version with js bson

I also fixed the benchmark tests to work with the new style of exporting. I have kept the tests using the createBSON helper to keep the diff smaller, I have those changes locally that I can do in a separate PR.

Another note, you'll notice the exported functions are called with: .bind(BSON) this is because they don't work if you pull them off the BSON instance. Without this, const {serialize} = require('bson-ext') doesn't work for example.

NODE-2944

@nbbeeken nbbeeken requested review from emadum and dariakp May 18, 2021 12:55
@nbbeeken nbbeeken marked this pull request as ready for review May 18, 2021 12:55
@nbbeeken nbbeeken requested a review from durran May 19, 2021 14:30
Copy link
Member

@durran durran left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@emadum emadum left a comment

Choose a reason for hiding this comment

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

LGTM!

@nbbeeken nbbeeken changed the base branch from master to 4.0 May 20, 2021 16:00
Copy link
Collaborator

@dariakp dariakp left a comment

Choose a reason for hiding this comment

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

LGTM

@nbbeeken nbbeeken merged commit 1273e72 into 4.0 May 20, 2021
@nbbeeken nbbeeken deleted the NODE-2944/bson-ext-support-v2 branch May 20, 2021 17:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants