Skip to content

Commit c8a2c9c

Browse files
committed
RM PR fixes 1
1 parent 0c0f1de commit c8a2c9c

File tree

11 files changed

+33
-61
lines changed

11 files changed

+33
-61
lines changed

source/fundamentals/builders.txt

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ Overview
2424
--------
2525

2626
This section includes guides on how to use each of the available
27-
builders and demonstrates the utility that the {+driver-short} builder
27+
builders and demonstrates the utility that the {+driver-short+} builder
2828
classes provide.
2929

30-
The {+driver-short} provides classes to simplify the process of
31-
performing CRUD operations and the Aggregation API. The static utility
32-
methods allow you to build queries and other kinds of documents more
33-
efficiently.
30+
The {+driver-short+} provides classes to simplify the process of
31+
performing CRUD operations and using the Aggregation API. The static
32+
utility methods allow you to build queries and other kinds of documents
33+
more efficiently.
3434

3535
Why Use Builders?
3636
-----------------
@@ -46,10 +46,10 @@ the MongoDB shell or plain {+language+} instead, you write operators as
4646
strings and get no visual indication of a problem, which pushes these
4747
errors to runtime instead of compile time.
4848

49-
By using builder classes, you cab write operators as methods. The IDE
50-
instantly indicates whether your code has errors. While developing, the
51-
IDE also shows you the methods you can use and can complete your code with
52-
placeholder parameters.
49+
By using builder classes, you can write operators as methods, so that
50+
your IDE instantly indicates whether your code has errors. While
51+
developing, your IDE can also show you methods that you can use and can
52+
complete your code with placeholder parameters.
5353

5454
Example Scenario
5555
----------------
@@ -60,8 +60,7 @@ collection that meet the following criteria:
6060
- Users in which the value of the ``gender`` field is ``"female"``
6161
- Users in which the value of the ``age`` field is greater than ``29``
6262

63-
You only want their email addresses, so your query won't
64-
return data that you don't need.
63+
You also need your query to return only their email addresses.
6564

6665
The documents in the ``users`` collection are modeled by the following
6766
data class:
@@ -88,6 +87,10 @@ builders in the {+driver-short+}:
8887
.. literalinclude:: /examples/generated/BuildersTest.snippet.no-builders.kt
8988
:language: kotlin
9089

90+
In this case, you could easily include an error when writing the
91+
``"\$gt"`` operator in the filter, but you would see an error only at
92+
runtime.
93+
9194
Using Builders
9295
~~~~~~~~~~~~~~
9396

source/fundamentals/builders/aggregates.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,7 @@ modeled by the following ``Movie`` data class for use with the Kotlin driver:
5454
.. literalinclude:: /examples/generated/AggregatesBuilderTest.snippet.movie-data-class.kt
5555
:language: kotlin
5656

57-
.. tip:: Aggregates and Data Class Properties
58-
59-
You can use methods from the ``Aggregates`` and
60-
``Accumulators`` classes directly with data class
61-
properties by adding the optional {+driver-short+} extensions
62-
dependency to your application. To learn more and view examples, see
63-
the :ref:`kotlin-builders-data-classes` guide.
57+
.. include:: /includes/fundamentals/builders-dataclass.rst
6458

6559
Match
6660
-----

source/fundamentals/builders/builders-data-classes.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,9 @@ dependency to your project by using the :guilabel:`Gradle` and
7777

7878
After you install the extensions dependency, you can use the extension
7979
methods by importing classes and methods from the
80-
``com.mongodb.kotlin.client.model`` path. You can access the standard
81-
builder classes and methods from the ``com.mongodb.client.model`` path,
82-
so you can mix calls that reference string field names and data
83-
class properties in the same application.
80+
``com.mongodb.kotlin.client.model`` path. You can mix usage of these methods and
81+
the standard builder methods in the same application, as shown in the
82+
:ref:`kotlin-data-class-aggregates` example in this guide.
8483

8584
Builders Examples
8685
-----------------

source/fundamentals/builders/filters.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,7 @@ with the Kotlin driver:
8282
.. literalinclude:: /examples/generated/FiltersBuildersTest.snippet.paint-order-data-class.kt
8383
:language: kotlin
8484

85-
.. tip:: Filters and Data Class Properties
86-
87-
You can use methods from the ``Filters`` class directly with data class
88-
properties by adding the optional {+driver-short+} extensions
89-
dependency to your application. To learn more and view examples, see
90-
the :ref:`kotlin-builders-data-classes` guide.
85+
.. include:: /includes/fundamentals/builders-dataclass.rst
9186

9287
.. _comparison:
9388

source/fundamentals/builders/indexes.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,7 @@ instance, which you can pass to
4545

4646
import com.mongodb.client.model.Indexes.*
4747

48-
.. tip:: Indexes and Data Class Properties
49-
50-
You can use methods from the ``Indexes`` class directly with data class
51-
properties by adding the optional {+driver-short+} extensions
52-
dependency to your application. To learn more and view examples, see
53-
the :ref:`kotlin-builders-data-classes` guide.
48+
.. include:: /includes/fundamentals/builders-dataclass.rst
5449

5550
.. _ascending-indexes:
5651

source/fundamentals/builders/projections.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,7 @@ The following data class is used to represent the documents in the collection:
9595
.. literalinclude:: /examples/generated/ProjectionsBuildersTest.snippet.example-data-class.kt
9696
:language: kotlin
9797

98-
.. tip:: Projections and Data Class Properties
99-
100-
You can use methods from the ``Projections`` class directly with data class
101-
properties by adding the optional {+driver-short+} extensions
102-
dependency to your application. To learn more and view examples, see
103-
the :ref:`kotlin-builders-data-classes` guide.
98+
.. include:: /includes/fundamentals/builders-dataclass.rst
10499

105100
Projection Operations
106101
---------------------

source/fundamentals/builders/sort.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,7 @@ This data is modeled with the following Kotlin data class:
5353
.. literalinclude:: /examples/generated/SortTest.snippet.sort-data-model.kt
5454
:language: kotlin
5555

56-
.. tip:: Sorts and Data Class Properties
57-
58-
You can use methods from the ``Sorts`` class directly with data class
59-
properties by adding the optional {+driver-short+} extensions
60-
dependency to your application. To learn more and view examples, see
61-
the :ref:`kotlin-builders-data-classes` guide.
56+
.. include:: /includes/fundamentals/builders-dataclass.rst
6257

6358
The Sorts Class
6459
---------------

source/fundamentals/builders/updates.txt

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _updates-builders:
2+
13
================
24
Updates Builders
35
================
@@ -15,8 +17,6 @@ Updates Builders
1517
:depth: 2
1618
:class: singlecol
1719

18-
.. _updates-builders:
19-
2020
Overview
2121
--------
2222

@@ -68,12 +68,7 @@ This example is modeled by the following data class unless otherwise noted:
6868
.. literalinclude:: /examples/generated/UpdatesBuildersTest.snippet.example-data-class.kt
6969
:language: kotlin
7070

71-
.. tip:: Updates and Data Class Properties
72-
73-
You can use methods from the ``Updates`` class directly with data class
74-
properties by adding the optional {+driver-short+} extensions
75-
dependency to your application. To learn more and view examples, see
76-
the :ref:`kotlin-builders-data-classes` guide.
71+
.. include:: /includes/fundamentals/builders-dataclass.rst
7772

7873
.. _field_updates:
7974

source/fundamentals/data-formats/document-data-format-data-class.txt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,7 @@ as shown in the following code:
6060

6161
DataStorage(productName=tape, capacity=5.0)
6262

63-
.. tip:: Builders for Data Class Properties
64-
65-
You can use methods from builder classes directly with data class
66-
properties by adding the optional {+driver-short+} extensions
67-
dependency to your application. To learn more and view examples, see
68-
the :ref:`kotlin-builders-data-classes` guide.
63+
.. include:: /includes/fundamentals/builders-dataclass.rst
6964

7065
You specify a class for documents returned from a collection, even if it
7166
is different than the class you specified when retrieving the
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. tip:: Builder Methods and Data Class Properties
2+
3+
You can use the methods from builder classes directly with data
4+
class properties by adding the optional {+driver-short+} extensions
5+
dependency to your application. To learn more and view examples, see
6+
the :ref:`kotlin-builders-data-classes` guide.

0 commit comments

Comments
 (0)