Skip to content

Commit

Permalink
Address technical feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmorisi committed Aug 9, 2024
1 parent 328671c commit d8744fd
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions source/includes/connect/connection-targets.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,30 @@ import com.mongodb.kotlin.client.MongoClient

fun main() {
// start-connect
val connectionString = ConnectionString("<connection string URI>")

// Defines Stable API version
val serverApi = ServerApi.builder()
.version(ServerApiVersion.V1)
.build()

// Uses MongoClientSettings to apply connection string and specify the Stable API version
val settings = MongoClientSettings.builder()
.applyConnectionString(connectionString)
.applyConnectionString("<connection string URI>")
.serverApi(serverApi)
.build()

val mongoClient = MongoClient.create(settings)
// end-connect

// start-connect-local
val connectionString = ConnectionString("mongodb://localhost:27017")

val settings = MongoClientSettings.builder()
.applyConnectionString(connectionString)
.applyConnectionString("mongodb://localhost:27017")
.build()

val mongoClient = MongoClient.create(settings)
// end-connect-local

// start-connect-rs-connection-string
val connectionString = ConnectionString("mongodb://host1:27017,host2:27017,host3:27017/")
val mongoClient = MongoClient.create(connectionString)
val mongoClient = MongoClient.create("mongodb://host1:27017,host2:27017,host3:27017/")
// end-connect-rs-connection-string

// start-connect-rs-settings
Expand Down

0 comments on commit d8744fd

Please sign in to comment.