-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Minor - P4
-
Affects Version/s: 1.7.1
-
Component/s: Shell API
-
None
-
Environment:Ubuntu 22.04.1 LTS 5.15.0-1030-aws #34-Ubuntu SMP
mongod --version
db version v6.0.4
Build Info: {
"version": "6.0.4",
"gitVersion": "44ff59461c1353638a71e710f385a566bcd2f547",
"openSSLVersion": "OpenSSL 3.0.2 15 Mar 2022",
"modules": [],
"allocator": "tcmalloc",
"environment": {
"distmod": "ubuntu2204",
"distarch": "x86_64",
"target_arch": "x86_64"
}
}
mongosh --version
1.7.1
Ubuntu 22.04.1 LTS 5.15.0-1030-aws #34-Ubuntu SMP mongod --version db version v6.0.4 Build Info: { "version": "6.0.4", "gitVersion": "44ff59461c1353638a71e710f385a566bcd2f547", "openSSLVersion": "OpenSSL 3.0.2 15 Mar 2022", "modules": [], "allocator": "tcmalloc", "environment": { "distmod": "ubuntu2204", "distarch": "x86_64", "target_arch": "x86_64" } } mongosh --version 1.7.1
-
Not Needed
Problem Statement/Rationale
mongosh does not verify the collection name upon creation, and it will throw an Uncaught:
SyntaxError: Identifier directly after number. (1:4).
Please be sure to attach relevant logs with any sensitive data redacted.
Steps to Reproduce
How could an engineer replicate the issue you're reporting?
// code placeholder test> db.createCollection("0x123") { ok: 1 } test> db.0x123.distinct() Uncaught: SyntaxError: Identifier directly after number. (1:4)> 1 | db.0x123.distinct() | ^ 2 |test>
Expected Results
What do you expect to happen?
When creating a collection, it should verify that the collection name matches the naming constraints.
Actual Results
What do you observe is happening?
An uncaught SyntaxError: Identifier directly after number.
Additional Notes
Any additional information that may be useful to include.