[SERVER-42346] Cannot drop collection with characters like "_" and "-" . Created: 23/Jul/19  Updated: 24/Jul/19  Resolved: 24/Jul/19

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 4.0.10
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: NIKOLAY LOGINOV Assignee: Danny Hatcher (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows


Issue Links:
Duplicate
duplicates SERVER-445 Can't reference collection names begi... Closed
Operating System: ALL
Participants:

 Description   

MongoDB server version: 4.0.10

 > db.createCollection("service-test-42_1-DocDetailsType") 
{ "ok" : 1 }  
> show collections
service-test-42_1-DocDetailsType
> db.service-test-42_1-DocDetailsType.drop()
2019-07-23T13:41:39.939+0300 E QUERY    [js] SyntaxError: identifier starts immediately after numeric literal @(shell):1:16

May be linked with https://jira.mongodb.org/browse/SERVER-445

Workaround:

 > db.getCollection("service-test-42_1-DocDetailsType").drop()
true



 Comments   
Comment by Danny Hatcher (Inactive) [ 24/Jul/19 ]

As described in SERVER-445, this behavior is working as designed and is not a bug. The workaround you mentioned is specifically noted in our documentation as the correct way to refer to those collection names. Thus, I will close this ticket as a duplicate.

Generated at Thu Feb 08 05:00:15 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.