File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -71,15 +71,13 @@ export function formatCluster(cluster: ClusterDescription20240805): Cluster {
7171
7272 const instanceSize = regionConfigs [ 0 ] ?. instanceSize ?? "UNKNOWN" ;
7373 const clusterInstanceType = instanceSize === "M0" ? "FREE" : "DEDICATED" ;
74- const connectionString = cluster . connectionStrings ?. standardSrv || cluster . connectionStrings ?. standard ;
7574
7675 return {
7776 name : cluster . name ,
7877 instanceType : clusterInstanceType ,
7978 instanceSize : clusterInstanceType === "DEDICATED" ? instanceSize : undefined ,
8079 state : cluster . stateName ,
8180 mongoDBVersion : cluster . mongoDBVersion ,
82- connectionString,
8381 connectionStrings : cluster . connectionStrings ,
8482 processIds : extractProcessIds ( cluster . connectionStrings ?. standard ?? "" ) ,
8583 } ;
@@ -89,6 +87,9 @@ export function getConnectionString(
8987 connectionStrings : ClusterConnectionStrings ,
9088 connectionType : "standard" | "private"
9189) : string | undefined {
90+ if ( connectionStrings === undefined ) {
91+ return undefined ;
92+ }
9293 if ( connectionType === "standard" ) {
9394 return connectionStrings . standardSrv || connectionStrings . standard ;
9495 }
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ export class ConnectClusterTool extends AtlasToolBase {
119119 expiryDate,
120120 } ;
121121
122- const cn = new URL ( cluster . connectionString ) ;
122+ const cn = new URL ( connectionString ) ;
123123 cn . username = username ;
124124 cn . password = password ;
125125 cn . searchParams . set ( "authSource" , "admin" ) ;
You can’t perform that action at this time.
0 commit comments