You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/fundamentals/databases-collections.txt
+46-49Lines changed: 46 additions & 49 deletions
Original file line number
Diff line number
Diff line change
@@ -14,53 +14,54 @@ Overview
14
14
--------
15
15
16
16
In this guide, you can learn how to use MongoDB databases and
17
-
collections with the MongoDB Java driver.
17
+
collections with the MongoDB Kotlin driver.
18
18
19
-
MongoDB organizes data into a hierachy of the following levels:
19
+
MongoDB organizes data into a hierarchy of the following levels:
20
20
21
-
- Databases
21
+
#. **Databases**: Databases are the top level of data organization in a MongoDB instance.
22
22
23
-
- Collections
23
+
#. **Collections**: Databases are organized into collections which contain **documents**.
24
24
25
-
- Documents
25
+
#. **Documents**: Documents contain literal data such as strings, numbers, and dates, as well as other embedded documents. For more information on document field types and structure, see the :manual:`server documentation for documents </core/document/>`.
26
26
27
-
Databases are the top level of data organization in a MongoDB instance.
28
-
Databases are organized into collections which contain **documents**.
29
-
Documents
30
-
contain literal data such as strings, numbers, and dates as well as
31
-
other (embedded) documents. For more information on document field
32
-
types and structure, see the server documentation for
33
-
:manual:`documents </core/document/>`.
27
+
With the MongoDB Kotlin driver, data can be modeled using Kotlin data classes or you can use a
28
+
`Document <{+api+}/apidocs/bson/org/bson/Document.html>`__ class
29
+
to store and retrieve data from MongoDB.
30
+
31
+
.. TODO:(DOCSP-29224): add back in when document data format data classes are documented
32
+
.. To learn more about using data classes to store and retrieve data, refer to
33
+
.. :ref:`Document Data Format: Data Classes <fundamentals-data-classes>`.
34
34
35
35
Access a Database
36
36
-----------------
37
37
38
38
Use the `getDatabase()
39
-
<{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoClient.html#getDatabase(java.lang.String)>`__ method of
39
+
<{+api-kotlin+}/apidocs/mongodb-driver-kotlin-coroutine/mongodb-driver-kotlin-coroutine/com.mongodb.kotlin.client.coroutine/-mongo-client/get-database.html>`__ method of
40
40
a ``MongoClient`` instance to access a ``MongoDatabase`` in a MongoDB
41
41
instance.
42
42
43
43
The following example accesses a database named "testDatabase":
0 commit comments