Skip to content
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

Some minor improvements #9

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

Wernfried
Copy link

Support for MinKey and MaxKey
Check if property 'str' already exists on ObjectId
Remove function ISODate() for mongosh > 2.31.

Added support for MinKey and MaxKey in tojson()
Property should not be defined if already existing
Function not needed anymore with mongsh 2.3.1.
See https://jira.mongodb.org/browse/MONGOSH-1859
@@ -648,7 +653,7 @@ tojsonObject = function(x, indent, nolint, depth) {
if (typeof DBCollection != 'undefined' && val == DBCollection.prototype)
continue;

fieldStrings.push(indent + "\"" + k + "\" : " + tojson(val, indent, nolint, depth + 1));
fieldStrings.push(indent + k + ": " + tojson(val, indent, nolint, depth + 1));
Copy link
Collaborator

Choose a reason for hiding this comment

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

This breaks if k contains non-identifier characters, right? Just checking, this is already a bit broken either way (k couild probably also contain double quotes or backslashes)

Copy link
Author

Choose a reason for hiding this comment

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

Yes, it was more a change for my personal needs.
I think I reverted it in 7c83f98 - I am not the expert yet with git.

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