[DOCS-1595] Table listing JS equivalents of non-JS shell helpers Created: 10/Jun/13 Updated: 30/Oct/23 Resolved: 09/Jul/13 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | Server |
| Affects Version/s: | None |
| Fix Version/s: | Server_Docs_20231030 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Stennie Steneker (Inactive) | Assignee: | Allison Reinheimer Moore |
| Resolution: | Done | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Participants: | |||||||||
| Days since reply: | 10 years, 32 weeks, 1 day ago | ||||||||
| Description |
|
The documentation page on Write Scripts for the mongo Shell mentions that you cannot include use <dbname> inside a JavaScript file, but does not have a full list of equivalent JS for other interactive helpers such as "show dbs". We should include a table mapping these, for example:
It is also worth noting that in non-interactive mode (i.e. --eval) these commands will return the corresponding JavaScript data, but will not display any output. The printjson() function can be used to display the results of a JavaScript function, for example: printjson(db.adminCommand('listDatabases')). This should probably also be cross-referenced from Running .js files via a mongo shell Instance on the Server. |
| Comments |
| Comment by auto [ 09/Jul/13 ] |
|
Author: {u'username': u'schmalliso', u'name': u'schmalliso', u'email': u'allison.moore@10gen.com'}Message: Signed-off-by: Sam Kleinman <samk@10gen.com> |
| Comment by auto [ 09/Jul/13 ] |
|
Author: {u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}Message: |
| Comment by auto [ 09/Jul/13 ] |
|
Author: {u'username': u'schmalliso', u'name': u'schmalliso', u'email': u'allison.moore@10gen.com'}Message: Signed-off-by: Sam Kleinman <samk@10gen.com> |