Skip to content

Commit bfd6949

Browse files
authored
RUST-266 Add "sort" option to FindOneOptions (#122)
1 parent 75c76fb commit bfd6949

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/coll/options.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ impl From<FindOneOptions> for FindOptions {
712712
limit: None,
713713
max_await_time: None,
714714
no_cursor_timeout: None,
715-
sort: None,
715+
sort: options.sort,
716716
}
717717
}
718718
}
@@ -805,6 +805,10 @@ pub struct FindOneOptions {
805805
/// The number of documents to skip before counting.
806806
#[builder(default)]
807807
pub skip: Option<i64>,
808+
809+
/// The order of the documents for the purposes of the operation.
810+
#[builder(default)]
811+
pub sort: Option<Document>,
808812
}
809813

810814
/// Specifies an index to create.

0 commit comments

Comments
 (0)