Skip to content

Conversation

patrickfreed
Copy link
Contributor

Fix for SWIFT-1086

@patrickfreed patrickfreed requested a review from kmahar February 3, 2021 01:12
continue
}
guard v == otherValue else {
guard let otherValue = other[k], v.equalsIgnoreKeyOrder(otherValue) else {
Copy link
Contributor

Choose a reason for hiding this comment

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

now that I think about it, shouldn't this method just not exist because a public BSONDocument.equalsIgnoreKeyOrder is already defined in the BSON library?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are you referring to BSON.equalsIgnoreKeyOrder? That's necessary (or rather helpful) to ease in recursion, since we have to go through BSON for both arrays and documents. If you mean BSONDocument.sortedEquals in the driver, then yeah that can be replaced with this. I originally tried doing that during the perf work but ran into this bug, so I had to implement it directly over there first. Once this is merged I'll open a follow-up PR updating the driver's implementation to just wrap this.

Copy link
Contributor

Choose a reason for hiding this comment

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

lol whoops, I don't know why but I was thinking this was a PR against the driver itself 🤦‍♀️ nvm me

@patrickfreed patrickfreed merged commit 4c9f380 into mongodb:master Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants