[−][src]Struct mongodb_cursor_pagination::PaginatedCursor
The main entry point for finding documents
Methods
impl<'a> PaginatedCursor
[src]
pub fn new(
options: Option<FindOptions>,
cursor: Option<String>,
direction: Option<CursorDirections>
) -> Self
[src]
options: Option<FindOptions>,
cursor: Option<String>,
direction: Option<CursorDirections>
) -> Self
Updates or creates all of the find options to help with pagination and returns a PaginatedCursor object.
Arguments
options
- Optional find options that you would like to perform any searches withcursor
- An optional existing cursor in base64. This would have come from a previous FindResultdirection
- Determines whether the cursor supplied is for a previous page or the next page. Defaults to Next
pub fn estimated_document_count(
&self,
collection: &Collection
) -> Result<i64, CursorError>
[src]
&self,
collection: &Collection
) -> Result<i64, CursorError>
Estimates the number of documents in the collection using collection metadata.
pub fn count_documents(
&self,
collection: &Collection,
query: Option<&Document>
) -> Result<i64, CursorError>
[src]
&self,
collection: &Collection,
query: Option<&Document>
) -> Result<i64, CursorError>
Gets the number of documents matching filter.
Note that using PaginatedCursor::estimated_document_count
is recommended instead of this method is most cases.
pub fn find<T>(
&self,
collection: &Collection,
filter: Option<&Document>
) -> Result<FindResult<T>, CursorError> where
T: Deserialize<'a>,
[src]
&self,
collection: &Collection,
filter: Option<&Document>
) -> Result<FindResult<T>, CursorError> where
T: Deserialize<'a>,
Finds the documents in the collection
matching filter
.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for PaginatedCursor
impl Send for PaginatedCursor
impl Sync for PaginatedCursor
impl Unpin for PaginatedCursor
impl !UnwindSafe for PaginatedCursor
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,