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

Error when trying to view collection that contains a dash ( - ) in name #113

Closed
surgicalcoder opened this issue Feb 15, 2016 · 1 comment

Comments

@surgicalcoder
Copy link

When attempting to run:

db.Service-AzureCredentials-AzureSubscription.find({

})

I get the following error:

Error : AzureCredentials is not defined ReferenceError: AzureCredentials is not defined at evalmachine.:1:12 at ContextifyScript.Script.runInNewContext (vm.js:18:15) at D:\Downloads\Mongotron-win32-x64 (1)\Mongotron-win32-x64\resources\app.asar\node_modules\lib\modules\expression\index.js:168:23 at Promise._execute (D:\Downloads\Mongotron-win32-x64 (1)\Mongotron-win32-x64\resources\app.asar\node_modules\bluebird\js\release\debuggability.js:159:9) at Promise._resolveFromExecutor (D:\Downloads\Mongotron-win32-x64 (1)\Mongotron-win32-x64\resources\app.asar\node_modules\bluebird\js\release\promise.js:460:18) at new Promise (D:\Downloads\Mongotron-win32-x64 (1)\Mongotron-win32-x64\resources\app.asar\node_modules\bluebird\js\release\promise.js:76:14) at _eval2 (D:\Downloads\Mongotron-win32-x64 (1)\Mongotron-win32-x64\resources\app.asar\node_modules\lib\modules\expression\index.js:139:10) at D:\Downloads\Mongotron-win32-x64 (1)\Mongotron-win32-x64\resources\app.asar\node_modules\lib\modules\expression\index.js:38:9 at Promise._execute (D:\Downloads\Mongotron-win32-x64 (1)\Mongotron-win32-x64\resources\app.asar\node_modules\bluebird\js\release\debuggability.js:159:9) at Promise._resolveFromExecutor (D:\Downloads\Mongotron-win32-x64 (1)\Mongotron-win32-x64\resources\app.asar\node_modules\bluebird\js\release\promise.js:460:18)

@officert
Copy link
Owner

Closing this because it's a duplicate of #68

@surgicalcoder this has been fixed in this release https://github.com/officert/mongotron/releases/tag/1.0.0-alpha.3

you will need to use bracket notation in the latest release to query collections with hyphens in the name.

db['Service-AzureCredentials-AzureSubscription]'.find({

})

the query editor in Mongotron is just a JS REPL and evaluates any Javascript. So like Javascript accessing object properties containing hyphens you have to use bracket notation.

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

No branches or pull requests

2 participants