Skip to content

Commit 774fc9a

Browse files
committed
Add firestore regexp
1 parent cfa0e31 commit 774fc9a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/mongodb-build-info/src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const LOCALHOST_REGEX =
99
const DIGITAL_OCEAN_REGEX = /\.mongo\.ondigitalocean\.com$/i;
1010
const COSMOS_DB_REGEX = /\.cosmos\.azure\.com$/i;
1111
const DOCUMENT_DB_REGEX = /docdb(-elastic)?\.amazonaws\.com$/i;
12+
const FIRESTORE_REGEX = /\.firestore.goog$/i;
1213

1314
function isRecord(value: unknown): value is Record<string, unknown> {
1415
return typeof value === 'object' && value !== null;
@@ -149,6 +150,10 @@ export async function identifyServerName(
149150
return 'documentdb';
150151
}
151152

153+
if (hostname.match(FIRESTORE_REGEX)) {
154+
return 'firestore';
155+
}
156+
152157
const buildInfo = await runCommand({ buildInfo: 1 });
153158

154159
if ('ferretdb' in buildInfo) {

0 commit comments

Comments
 (0)