Skip to content

Commit 49666ab

Browse files
committed
implement technical feedback
1 parent a81cae4 commit 49666ab

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

source/includes/write/transaction.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import com.mongodb.*
2-
import com.mongodb.client.ClientSession
3-
import com.mongodb.client.MongoClients
1+
import com.mongodb.kotlin.client.ClientSession
2+
import com.mongodb.kotlin.client.MongoClient
43
import org.bson.Document
54

65
// start-data-class
@@ -10,7 +9,7 @@ data class Restaurant(val name: String, val cuisine: String)
109
fun main() {
1110
// start-transaction
1211
// Creates a new MongoClient to manage your connection
13-
val client = MongoClients.create("<connection string>")
12+
val client = MongoClient.create("<connection string>")
1413

1514
// Gets the database and collection
1615
val database = client.getDatabase("sample_restaurants")

source/write/transactions.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ through the following steps:
120120
#. Define the ``insertRestaurantsInTransaction()`` method to insert multiple
121121
documents into the ``restaurants`` collection.
122122
#. Use the ``withTransaction()`` method to start a transaction. The ``withTransaction()``
123-
method runs the insert operation and commits the transaction. If any
123+
method runs the insert operations and commits the transaction. If any
124124
operation results in errors, ``withTransaction()`` cancels the transaction.
125125
#. Close the connection to the server by using the ``MongoClient.close()`` method.
126126

0 commit comments

Comments
 (0)