Share via

Cannot drop databases with corrupted names (trailing newline character) on MongoDB vCore cluster

Mikey Casalaina 5 Reputation points
2026-02-07T15:27:02.0466667+00:00

I have two databases on my Azure Cosmos DB for MongoDB vCore cluster whose names contain a trailing newline character (U+000A). These appear as dev\n and prod\n in db.adminCommand('listDatabases') output, distinct from my legitimate dev and prod  databases.

I cannot drop them through any means:

  • db.getSiblingDB("dev\n").dropDatabase() via mongosh — fails
  • MongoDB Node.js driver with the literal newline — fails
  • Azure Portal — does not display these databases
  • Azure CLI — no database-level drop command for vCore clusters

Databases to delete:

  1. dev\n (4 chars: d,e,v,linefeed) — 9 collections including CORRUPTED
  2. prod\n (5 chars: p,r,o,d,linefeed) — 5 collections including CORRUPTED

Databases to keep: dev, prod, meevee-v3

All data in the corrupted databases is duplicated and can be safely deleted. Could someone from the Azure Cosmos DB team assist with removing these server-side?

Azure Cosmos DB
Azure Cosmos DB

An Azure NoSQL database service for app development.

{count} vote

1 answer

Sort by: Most helpful
  1. Q&A Assist
    2026-02-07T15:27:13.7266667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    It seems that you are encountering an issue with dropping databases that have corrupted names due to a trailing newline character in Azure Cosmos DB for MongoDB. Unfortunately, the current capabilities of Azure Cosmos DB for MongoDB do not provide a direct way to drop databases with such corrupted names through the usual methods (mongosh, Node.js driver, Azure Portal, or Azure CLI).

    Since these databases are not accessible through standard commands and Azure Portal does not display them, the best course of action would be to reach out to Azure support for assistance. They may have the necessary tools and permissions to handle such cases on the server-side and help you remove these corrupted databases.

    Make sure to provide them with all relevant details, including the resource ID and the exact names of the databases you wish to drop. This will help them assist you more effectively.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.