File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
packages/mongodb-build-info/src Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ export function getGenuineMongoDB(uri: string): {
140140export async function identifyServerName (
141141 uri : string ,
142142 runCommand : ( command : Document ) => Promise < Document > ,
143+ adminCommand : ( command : Document ) => Promise < Document > ,
143144) : Promise < string > {
144145 const hostname = getHostnameFromUrl ( uri ) ;
145146 if ( hostname . match ( COSMOS_DB_REGEX ) ) {
@@ -160,6 +161,14 @@ export async function identifyServerName(
160161 return 'ferretdb' ;
161162 }
162163
164+ try {
165+ await adminCommand ( { getParameter : 'foo' } ) ;
166+ } catch ( error ) {
167+ if ( error instanceof Error && / d o c u m e n t d b _ a p i / . test ( error . message ) ) {
168+ return 'pg_documentdb' ;
169+ }
170+ }
171+
163172 return 'mongodb' ;
164173}
165174
You can’t perform that action at this time.
0 commit comments