Skip to content

Commit c19f411

Browse files
RUST-1912 Document that projection may cause deserialization errors (#1177)
1 parent 171db34 commit c19f411

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/coll/options.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,13 @@ pub struct FindOptions {
816816
/// Whether the server should close the cursor after a period of inactivity.
817817
pub no_cursor_timeout: Option<bool>,
818818

819-
/// Limits the fields of the document being returned.
819+
/// The [projection document](https://www.mongodb.com/docs/manual/reference/method/db.collection.find/#projection)
820+
/// to determine which fields to include in the returned document.
821+
///
822+
/// Specifying this option may cause deserialization errors if the returned fields do not fit
823+
/// the schema of the collection's generic type. The
824+
/// [`clone_with_type`](crate::Collection::clone_with_type) method can be used to retrieve a
825+
/// handle to the collection with a different generic type configured.
820826
pub projection: Option<Document>,
821827

822828
/// The read concern to use for this find query.

0 commit comments

Comments
 (0)