pub struct QueryRequest {
pub query: String,
pub collectionname: String,
pub projection: String,
pub top: i32,
pub skip: i32,
pub orderby: String,
pub queryas: String,
pub explain: bool,
}
Expand description
MongoDB Query Request.
Fields§
§query: String
MongoDB Query to execute. This field is required.
collectionname: String
MongoDB Collection to query. This field is required.
projection: String
MongoDB Query projection. This field is optional.
top: i32
MongoDB Maximum number of documents to return. This field is optional with a default of 100.
skip: i32
MongoDB Number of documents to skip, used for paging on the same query. This field is optional with a default of 0.
orderby: String
MongoDB order by. This field is optional with a default of {“_id”: 1}. You can specify “timestamp” as a string or an object like {“timestamp”: -1}.
queryas: String
Query as if you were this _id. (_id can be a user, role, or customer from the users collection)
explain: bool
Enabling explain will provides information on the execution of the query
Implementations§
Source§impl QueryRequest
impl QueryRequest
Sourcepub fn with_query(collectionname: &str, query: &str) -> QueryRequest
pub fn with_query(collectionname: &str, query: &str) -> QueryRequest
Creates a new QueryRequest
with the given collectionname
and query
.
Sourcepub fn with_projection(
collectionname: &str,
query: &str,
projection: &str,
) -> QueryRequest
pub fn with_projection( collectionname: &str, query: &str, projection: &str, ) -> QueryRequest
Creates a new QueryRequest
with the given collectionname
, query
and projection
.
Source§impl QueryRequest
impl QueryRequest
Sourcepub fn to_envelope(&self) -> Envelope
pub fn to_envelope(&self) -> Envelope
Converts the QueryRequest
to an Envelope
.
Trait Implementations§
Source§impl Clone for QueryRequest
impl Clone for QueryRequest
Source§fn clone(&self) -> QueryRequest
fn clone(&self) -> QueryRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for QueryRequest
impl Debug for QueryRequest
Source§impl Default for QueryRequest
impl Default for QueryRequest
Source§fn default() -> QueryRequest
fn default() -> QueryRequest
Source§impl Message for QueryRequest
impl Message for QueryRequest
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.Source§impl PartialEq for QueryRequest
impl PartialEq for QueryRequest
impl StructuralPartialEq for QueryRequest
Auto Trait Implementations§
impl Freeze for QueryRequest
impl RefUnwindSafe for QueryRequest
impl Send for QueryRequest
impl Sync for QueryRequest
impl Unpin for QueryRequest
impl UnwindSafe for QueryRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request