Skip to content

added print #1322

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

Closed
wants to merge 1 commit into from
Closed

added print #1322

wants to merge 1 commit into from

Conversation

danlangford
Copy link

informing people that a print() method exists. useful when writing scripts to pluck out specific data that can be pipped to other command line tools

informing people that a print() method exists. useful when writing scripts to pluck out specific data that can be pipped to other command line tools
@tychoish
Copy link
Contributor

The print() method is actually not MongoDB specific and is available because the mongo shell provides complete access to its underlying JavaScript environment. As a general rule, we avoid documenting JavaScript directly. I hope this makes sense, please feel free to ask any questions you have about this strategy. Thanks for your efforts here!

Regards,
sam

@tychoish tychoish closed this Oct 16, 2013
@danlangford
Copy link
Author

does your documentation state which JS environment the mongo shell is built upon? the print() method is not native to nodeJS, and in a Chrome console that method pulls up the dialog to print the page. In fact most javascripters are use to using console.log() which is not available in your underlying JS environment. maybe a link could be provided to another page of documentation provided by the underlying JS environment. what environment is it?

@tychoish
Copy link
Contributor

Starting in version 2.4 MongoDB uses the V8 javascript engine. Earlier versions of MongoDB used SpiderMonkey.

I should correct my earlier statement: while this function is a native function from v8, its something that MongoDB explicitly injects into the scope of the v8 environment. We should probably document this, but we should also coordinate this with the other methods injected into the environment that we don't document. I'll open a new ticket or append an item to an existing ticket.

Cheers,
sam

mongo-cr-bot pushed a commit that referenced this pull request Jun 23, 2022
mongodb-server-docs-sync-bot bot pushed a commit that referenced this pull request Jun 26, 2025
….9 Release Notes (#1322)

* (DOCSP-29609) Moved the orgID required to breaking changes in the 1.19.1 release notes

* Tech review. Searched for orgId and made sure it is specified as required in all places and examples where it is mentioned. Thank you, Nam
mongodb-server-docs-sync-bot bot pushed a commit that referenced this pull request Jun 26, 2025
….9 Release Notes (#1322)

* (DOCSP-29609) Moved the orgID required to breaking changes in the 1.19.1 release notes

* Tech review. Searched for orgId and made sure it is specified as required in all places and examples where it is mentioned. Thank you, Nam
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