Skip to content

Conversation

LijieZhang1998
Copy link
Contributor

https://jira.mongodb.org/browse/STREAMS-1964 contains the functions/properties added or modified.

};

BinData.prototype.nativeToString = BinData.prototype.toString;
BinData.prototype.toString = function (encoding) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The functionality of $function and new shell differs for toString(). Use const a = new BinData(0, 'SGVsbG8gV29ybGQ=') as an example. For $function, a.toString() returns BinData(0, 'SGVsbG8gV29ybGQ='). For new shell, it returns hello world. When encoding exists in the caller, they return the same result. Should we keep the behavior of existing $function or new shell.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Well, the goal here is maximum compatibility with $function and the legacy shell, so this seems reasonable to me

@addaleax addaleax merged commit a3f5841 into mongodb-labs:main Oct 8, 2025
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