mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 17:10:48 +01:00
fd05a7c3b3
GitOrigin-RevId: f7d2485163e820162f33c4d600cf18c4bf89b6d0
21 lines
649 B
JavaScript
21 lines
649 B
JavaScript
/**
|
|
* Test that hyphenated database name can work with dbStats when directoryperdb is turned on.
|
|
*
|
|
* @tags: [requires_persistence]
|
|
*/
|
|
var isDirectoryPerDBSupported =
|
|
jsTest.options().storageEngine == "wiredTiger" || !jsTest.options().storageEngine;
|
|
if (!isDirectoryPerDBSupported)
|
|
quit();
|
|
|
|
const dbName = "test-hyphen";
|
|
let conn = MongoRunner.runMongod({directoryperdb: ''});
|
|
|
|
conn.getDB(dbName).a.insert({x: 1});
|
|
let res = conn.getDB(dbName).runCommand({dbStats: 1, scale: 1});
|
|
jsTestLog("dbStats: " + tojson(res));
|
|
assert(res.db == "test-hyphen");
|
|
assert(res.fsUsedSize > 0);
|
|
assert(res.fsTotalSize > 0);
|
|
|
|
MongoRunner.stopMongod(conn); |