@@ -12,8 +12,8 @@ use crate::{
12
12
selection_criteria:: SelectionCriteria ,
13
13
} ;
14
14
15
- /// These are the valid options for creating a `Collection` with
16
- /// `Database::collection_with_options`.
15
+ /// These are the valid options for creating a [ `Collection`](../struct.Collection.html) with
16
+ /// [ `Database::collection_with_options`](../struct.Database.html#method.collection_with_options) .
17
17
#[ derive( Debug , Default , TypedBuilder ) ]
18
18
pub struct CollectionOptions {
19
19
/// The default read preference for operations.
@@ -29,7 +29,9 @@ pub struct CollectionOptions {
29
29
pub write_concern : Option < WriteConcern > ,
30
30
}
31
31
32
- /// Specifies whether a `Collection::find_one_and_replace` and `Collection::find_one_and_update`
32
+ /// Specifies whether a
33
+ /// [`Collection::find_one_and_replace`](../struct.Collection.html#method.find_one_and_replace) and
34
+ /// [`Collection::find_one_and_update`](../struct.Collection.html#method.find_one_and_update)
33
35
/// operation should return the document before or after modification.
34
36
#[ derive( Debug ) ]
35
37
pub enum ReturnDocument {
@@ -73,7 +75,8 @@ pub enum CursorType {
73
75
TailableAwait ,
74
76
}
75
77
76
- /// Specifies the options to a `Collection::insert_one` operation.
78
+ /// Specifies the options to a
79
+ /// [`Collection::insert_one`](../struct.Collection.html#method.insert_one) operation.
77
80
#[ derive( Clone , Debug , Default , TypedBuilder ) ]
78
81
pub struct InsertOneOptions {
79
82
/// Opt out of document-level validation.
@@ -85,7 +88,8 @@ pub struct InsertOneOptions {
85
88
pub write_concern : Option < WriteConcern > ,
86
89
}
87
90
88
- /// Specifies the options to a `Collection::insert_many` operation.
91
+ /// Specifies the options to a
92
+ /// [`Collection::insert_many`](../struct.Collection.html#method.insert_many) operation.
89
93
#[ skip_serializing_none]
90
94
#[ derive( Clone , Debug , Default , TypedBuilder , Serialize , Deserialize ) ]
91
95
#[ serde( rename_all = "camelCase" ) ]
@@ -154,7 +158,9 @@ impl From<Vec<Document>> for UpdateModifications {
154
158
}
155
159
}
156
160
157
- /// Specifies the options to a `Collection::update_one` or `Collection::update_many` operation.
161
+ /// Specifies the options to a
162
+ /// [`Collection::update_one`](../struct.Collection.html#method.update_one) or
163
+ /// [`Collection::update_many`](../struct.Collection.html#method.update_many) operation.
158
164
#[ derive( Debug , Default , TypedBuilder ) ]
159
165
pub struct UpdateOptions {
160
166
/// A set of filters specifying to which array elements an update should apply.
@@ -204,7 +210,8 @@ impl UpdateOptions {
204
210
}
205
211
}
206
212
207
- /// Specifies the options to a `Collection::replace_one` operation.
213
+ /// Specifies the options to a
214
+ /// [`Collection::replace_one`](../struct.Collection.html#method.replace_one) operation.
208
215
#[ derive( Debug , Default , TypedBuilder ) ]
209
216
pub struct ReplaceOptions {
210
217
/// Opt out of document-level validation.
@@ -233,7 +240,9 @@ pub struct ReplaceOptions {
233
240
pub write_concern : Option < WriteConcern > ,
234
241
}
235
242
236
- /// Specifies the options to a `Collection::delete_one` or `Collection::delete_many` operation.
243
+ /// Specifies the options to a
244
+ /// [`Collection::delete_one`](../struct.Collection.html#method.delete_one) or
245
+ /// [`Collection::delete_many`](../struct.Collection.html#method.delete_many) operation.
237
246
#[ serde_with:: skip_serializing_none]
238
247
#[ derive( Debug , Default , TypedBuilder , Serialize ) ]
239
248
#[ serde( rename_all = "camelCase" ) ]
@@ -250,7 +259,9 @@ pub struct DeleteOptions {
250
259
pub write_concern : Option < WriteConcern > ,
251
260
}
252
261
253
- /// Specifies the options to a `Collection::find_one_and_delete` operation.
262
+ /// Specifies the options to a
263
+ /// [`Collection::find_one_and_delete`](../struct.Collection.html#method.find_one_and_delete)
264
+ /// operation.
254
265
#[ derive( Debug , Default , TypedBuilder ) ]
255
266
pub struct FindOneAndDeleteOptions {
256
267
/// The maximum amount of time to allow the query to run.
@@ -280,7 +291,9 @@ pub struct FindOneAndDeleteOptions {
280
291
pub collation : Option < Collation > ,
281
292
}
282
293
283
- /// Specifies the options to a `Collection::find_one_and_replace` operation.
294
+ /// Specifies the options to a
295
+ /// [`Collection::find_one_and_replace`](../struct.Collection.html#method.find_one_and_replace)
296
+ /// operation.
284
297
#[ derive( Debug , Default , TypedBuilder ) ]
285
298
pub struct FindOneAndReplaceOptions {
286
299
/// Opt out of document-level validation.
@@ -322,13 +335,16 @@ pub struct FindOneAndReplaceOptions {
322
335
pub collation : Option < Collation > ,
323
336
}
324
337
325
- /// Specifies the options to a `Collection::find_one_and_update` operation.
338
+ /// Specifies the options to a
339
+ /// [`Collection::find_one_and_update`](../struct.Collection.html#method.find_one_and_update)
340
+ /// operation.
326
341
#[ derive( Debug , Default , TypedBuilder ) ]
327
342
pub struct FindOneAndUpdateOptions {
328
343
/// A set of filters specifying to which array elements an update should apply.
329
344
///
330
345
/// See the documentation [here](https://docs.mongodb.com/manual/reference/command/update/) for
331
- /// more information on array filters.#[builder(default)]
346
+ /// more information on array filters.
347
+ #[ builder( default ) ]
332
348
pub array_filters : Option < Vec < Document > > ,
333
349
334
350
/// Opt out of document-level validation.
@@ -370,7 +386,8 @@ pub struct FindOneAndUpdateOptions {
370
386
pub collation : Option < Collation > ,
371
387
}
372
388
373
- /// Specifies the options to a `Collection::aggregate` operation.
389
+ /// Specifies the options to a [`Collection::aggregate`](../struct.Collection.html#method.aggregate)
390
+ /// operation.
374
391
#[ skip_serializing_none]
375
392
#[ serde( rename_all = "camelCase" ) ]
376
393
#[ derive( Clone , Debug , Default , TypedBuilder , Serialize ) ]
@@ -452,7 +469,8 @@ pub struct AggregateOptions {
452
469
pub write_concern : Option < WriteConcern > ,
453
470
}
454
471
455
- /// Specifies the options to a `Collection::count_documents` operation.
472
+ /// Specifies the options to a
473
+ /// [`Collection::count_documents`](../struct.Collection.html#method.count_documents) operation.
456
474
#[ derive( Debug , Default , TypedBuilder ) ]
457
475
pub struct CountOptions {
458
476
/// The index to use for the operation.
@@ -482,7 +500,13 @@ pub struct CountOptions {
482
500
pub collation : Option < Collation > ,
483
501
}
484
502
485
- /// Specifies the options to a `Collection::estimated_document_count` operation.
503
+ // rustfmt tries to split the link up when it's all on one line, which breaks the link, so we wrap
504
+ // the link contents in whitespace to get it to render correctly.
505
+ //
506
+ /// Specifies the options to a
507
+ /// [
508
+ /// `Collection::estimated_document_count`
509
+ /// ](../struct.Collection.html#method.estimated_document_count) operation.
486
510
#[ serde_with:: skip_serializing_none]
487
511
#[ derive( Debug , Default , TypedBuilder , Serialize , Clone ) ]
488
512
#[ serde( rename_all = "camelCase" ) ]
@@ -498,16 +522,20 @@ pub struct EstimatedDocumentCountOptions {
498
522
) ]
499
523
pub max_time : Option < Duration > ,
500
524
525
+ /// The criteria used to select a server for this operation.
526
+ ///
527
+ /// If none specified, the default set on the collection will be used.
501
528
#[ builder( default ) ]
502
529
#[ serde( skip_serializing) ]
503
530
pub selection_criteria : Option < SelectionCriteria > ,
504
531
505
- /// The level of the read concern
532
+ /// The level of the read concern.
506
533
#[ builder( default ) ]
507
534
pub read_concern : Option < ReadConcern > ,
508
535
}
509
536
510
- /// Specifies the options to a `Collection::distinct` operation.
537
+ /// Specifies the options to a [`Collection::distinct`](../struct.Collection.html#method.distinct)
538
+ /// operation.
511
539
#[ serde_with:: skip_serializing_none]
512
540
#[ derive( Debug , Default , TypedBuilder , Serialize , Clone ) ]
513
541
#[ serde( rename_all = "camelCase" ) ]
@@ -523,11 +551,14 @@ pub struct DistinctOptions {
523
551
) ]
524
552
pub max_time : Option < Duration > ,
525
553
554
+ /// The criteria used to select a server for this operation.
555
+ ///
556
+ /// If none specified, the default set on the collection will be used.
526
557
#[ builder( default ) ]
527
558
#[ serde( skip_serializing) ]
528
559
pub selection_criteria : Option < SelectionCriteria > ,
529
560
530
- /// The level of the read concern
561
+ /// The level of the read concern.
531
562
#[ builder( default ) ]
532
563
pub read_concern : Option < ReadConcern > ,
533
564
@@ -539,7 +570,8 @@ pub struct DistinctOptions {
539
570
pub collation : Option < Collation > ,
540
571
}
541
572
542
- /// Specifies the options to a `Collection::find` operation.
573
+ /// Specifies the options to a [`Collection::find`](../struct.Collection.html#method.find)
574
+ /// operation.
543
575
#[ skip_serializing_none]
544
576
#[ derive( Debug , Default , TypedBuilder , Serialize ) ]
545
577
#[ serde( rename_all = "camelCase" ) ]
@@ -692,7 +724,8 @@ where
692
724
}
693
725
}
694
726
695
- /// Specifies the options to a `Collection::find_one` operation.
727
+ /// Specifies the options to a [`Collection::find_one`](../struct.Collection.html#method.find_one)
728
+ /// operation.
696
729
#[ derive( Debug , Default , TypedBuilder ) ]
697
730
pub struct FindOneOptions {
698
731
/// If true, partial results will be returned from a mongos rather than an error being
@@ -771,7 +804,8 @@ pub struct IndexModel {
771
804
pub options : Option < Document > ,
772
805
}
773
806
774
- /// Specifies the options to a `Collection::drop` operation.
807
+ /// Specifies the options to a [`Collection::drop`](../struct.Collection.html#method.drop)
808
+ /// operation.
775
809
#[ derive( Debug , Default , TypedBuilder , Serialize ) ]
776
810
#[ serde( rename_all = "camelCase" ) ]
777
811
pub struct DropCollectionOptions {
0 commit comments