[SERVER-9863] JavaScript execution failed after db.getSiblingDB() Created: 05/Jun/13 Updated: 16/Nov/21 Resolved: 05/Jun/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | 2.4.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | David Verdejo | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | execution, failed, javascript, mongo | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Wed Jun 05 10:57:32.561 [initandlisten] db version v2.4.4 |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Operating System: | ALL | ||||||||
| Steps To Reproduce: | use test ) |
||||||||
| Participants: | |||||||||
| Description |
|
We create a new test instance with mongo 2.4.4 and after we execute "db.getSiblingDB()", we see the following error: Wed Jun 05 11:06:53.529 JavaScript execution failed: Error: db initializer called with undefined argument at src/mongo/shell/mongo.js:L40 |
| Comments |
| Comment by Tad Marshall [ 05/Jun/13 ] | ||||||||||||||||
|
Filed | ||||||||||||||||
| Comment by Tad Marshall [ 05/Jun/13 ] | ||||||||||||||||
|
I filed | ||||||||||||||||
| Comment by David Verdejo [ 05/Jun/13 ] | ||||||||||||||||
|
Sorry, my fault because I don't see the param name. | ||||||||||||||||
| Comment by Tad Marshall [ 05/Jun/13 ] | ||||||||||||||||
|
Hi David, The getSiblingDB() shell helper function takes a string argument containing the name of the database you want to reference. Since you did not provide a string, the constructor for the DB object received the JavaScript type 'undefined' for the database name, resulting in the error. You can see the code for shell helper functions by typing the command without the parentheses:
The helper function is passing your argument (if any) to the getDB function, which is also a shell helper function, as is getMongo:
Is your bug report asking for different behavior from this command, or a more diagnostic error message, or something else? Tad |