pub struct Collection { /* private fields */ }
Implementations§
Source§impl Collection
impl Collection
pub fn new(database: Database, name: String) -> Self
pub fn name(&self) -> &str
pub fn database(&self) -> &Database
Sourcepub async fn upsert(
&self,
documents: Vec<Document>,
_timeout: Option<u64>,
build_index: bool,
) -> Result<Value>
pub async fn upsert( &self, documents: Vec<Document>, _timeout: Option<u64>, build_index: bool, ) -> Result<Value>
Upsert documents into the collection
Sourcepub async fn query(
&self,
document_ids: Option<Vec<String>>,
retrieve_vector: bool,
limit: Option<u32>,
offset: Option<u32>,
filter: Option<Filter>,
output_fields: Option<Vec<String>>,
sort: Option<Value>,
) -> Result<Vec<Document>>
pub async fn query( &self, document_ids: Option<Vec<String>>, retrieve_vector: bool, limit: Option<u32>, offset: Option<u32>, filter: Option<Filter>, output_fields: Option<Vec<String>>, sort: Option<Value>, ) -> Result<Vec<Document>>
Query documents by conditions
Sourcepub async fn search(
&self,
vectors: Vec<Vec<f64>>,
filter: Option<Filter>,
params: Option<SearchParams>,
retrieve_vector: bool,
limit: u32,
output_fields: Option<Vec<String>>,
_timeout: Option<u64>,
radius: Option<f64>,
) -> Result<Vec<Vec<Document>>>
pub async fn search( &self, vectors: Vec<Vec<f64>>, filter: Option<Filter>, params: Option<SearchParams>, retrieve_vector: bool, limit: u32, output_fields: Option<Vec<String>>, _timeout: Option<u64>, radius: Option<f64>, ) -> Result<Vec<Vec<Document>>>
Search similar vectors
Sourcepub async fn search_by_id(
&self,
document_ids: Vec<String>,
filter: Option<Filter>,
params: Option<SearchParams>,
retrieve_vector: bool,
limit: u32,
output_fields: Option<Vec<String>>,
_timeout: Option<u64>,
radius: Option<f64>,
) -> Result<Vec<Vec<Document>>>
pub async fn search_by_id( &self, document_ids: Vec<String>, filter: Option<Filter>, params: Option<SearchParams>, retrieve_vector: bool, limit: u32, output_fields: Option<Vec<String>>, _timeout: Option<u64>, radius: Option<f64>, ) -> Result<Vec<Vec<Document>>>
Search by document IDs
Sourcepub async fn update(
&self,
data: Document,
document_ids: Option<Vec<String>>,
filter: Option<Filter>,
) -> Result<Value>
pub async fn update( &self, data: Document, document_ids: Option<Vec<String>>, filter: Option<Filter>, ) -> Result<Value>
Update documents
Sourcepub async fn delete(
&self,
document_ids: Option<Vec<String>>,
filter: Option<Filter>,
limit: Option<u32>,
) -> Result<Value>
pub async fn delete( &self, document_ids: Option<Vec<String>>, filter: Option<Filter>, limit: Option<u32>, ) -> Result<Value>
Delete documents
Sourcepub async fn rebuild_index(&self) -> Result<Value>
pub async fn rebuild_index(&self) -> Result<Value>
Rebuild index
Trait Implementations§
Source§impl Clone for Collection
impl Clone for Collection
Source§fn clone(&self) -> Collection
fn clone(&self) -> Collection
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for Collection
impl !RefUnwindSafe for Collection
impl Send for Collection
impl Sync for Collection
impl Unpin for Collection
impl !UnwindSafe for Collection
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
Mutably borrows from an owned value. Read more