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
Collection name with dash (-) symbol raises reference error on JavaScript shell arangosh #497
Comments
Because
|
I agree to @F21. You can create a collection with a name that contains a dash in ArangoDB. This has nothing to do with ArangoDB, but is a feature of the JavaScript language. The language disallows using special characters such as the dash in identifier names. |
In my humble opinion, we should then not allow collection names with the underscore (_), or the dash (-) symbol . It is not consistent. |
The underscore is needed though, because they are used for naming system collections, like |
The underscore is actually allowed in JavaScript identifiers, too. And I think there is no problem with allowing the dash for collection names, too. Btw. in Javascript you can even have attribute names such as
by using them properly quoted:
|
Also, underscore is widely used for naming tables and fields in databases 😄 ,so if it's not an issue like the dash is, maybe we should probably let this one pass (even if it's not consistent 😄 ). |
OS version: Ubuntu 12.10
Shell version:
Welcome to arangosh 1.2.3. Copyright (c) triAGENS GmbH
Using Google V8 3.16.14 JavaScript engine, READLINE 6.2, ICU 4.8.1.1
Connected to ArangoDB 'tcp://localhost:8529' version 1.2.3
Steps to recreate:
arangosh> db._createEdgeCollection("has-emails");
[ArangoCollection 21131514, "has-emails" (type edge, status loaded)]
arangosh> db.has-emails
JavaScript exception in file '(shell)' at 1,8: ReferenceError: emails is not defined
!db.has-emails
! ^
stacktrace: ReferenceError: emails is not defined
at (shell):1:8
Collections without a dash (-) symbol works well.
arangosh> db.has_emails
[ArangoCollection 22835450, "has_emails" (type edge, status loaded)]
arangosh> db.entity
[ArangoCollection 9597178, "entity" (type document, status loaded)]
The text was updated successfully, but these errors were encountered: