@@ -22,20 +22,18 @@ Use Builders Code Pattern
22
22
Overview
23
23
--------
24
24
25
- This page describes how to implement the builders pattern in your code and describes
26
- benefits of using builder classes .
25
+ This page describes how to the various available builders in your code and describes
26
+ benefits of using the provided builders .
27
27
28
28
The {+driver-short+} provides type-safe builder classes and methods that enable developers to
29
- efficiently build queries and aggregations. To learn more about the builders pattern,
30
- see `Type-safe builders <https://kotlinlang.org/docs/type-safe-builders.html>`__ in the
31
- {+language+} documentation.
29
+ efficiently build queries and aggregations.
32
30
33
- Why Use the Builders Code Pattern ?
34
- ----------------------------------
31
+ Why Use Builders?
32
+ -----------------
35
33
36
34
If you use only plain {+language+} to construct BSON query documents, you are not
37
- able to identify errors in your code until runtime. When you use builder classes, you can
38
- write operators as methods and any syntax errors will be caught at compile time .
35
+ able to identify syntax errors until runtime. The builders help ensure the corretness of
36
+ syntax and can be less verbose than constructing BSON documents .
39
37
40
38
Example
41
39
-------
@@ -89,10 +87,10 @@ query filter:
89
87
:copyable:
90
88
:dedent:
91
89
92
- Builders Pattern
93
- ~~~~~~~~~~~~~~~~
90
+ Builders
91
+ ~~~~~~~~
94
92
95
- The following example performs the query by using the builders pattern :
93
+ The following example performs the query by using the builder helpers :
96
94
97
95
.. literalinclude:: /includes/builders/builders.kt
98
96
:start-after: start-find-builders
0 commit comments