Trait bonsaidb::core::connection::LowLevelConnection
pub trait LowLevelConnection: HasSession {
Show 28 methods
fn schematic(&self) -> &Schematic;
fn apply_transaction(
&self,
transaction: Transaction
) -> Result<Vec<OperationResult, Global>, Error>;
fn get_from_collection(
&self,
id: DocumentId,
collection: &CollectionName
) -> Result<Option<OwnedDocument>, Error>;
fn get_multiple_from_collection(
&self,
ids: &[DocumentId],
collection: &CollectionName
) -> Result<Vec<OwnedDocument, Global>, Error>;
fn list_from_collection(
&self,
ids: Range<DocumentId>,
order: Sort,
limit: Option<u32>,
collection: &CollectionName
) -> Result<Vec<OwnedDocument, Global>, Error>;
fn list_headers_from_collection(
&self,
ids: Range<DocumentId>,
order: Sort,
limit: Option<u32>,
collection: &CollectionName
) -> Result<Vec<Header, Global>, Error>;
fn count_from_collection(
&self,
ids: Range<DocumentId>,
collection: &CollectionName
) -> Result<u64, Error>;
fn compact_collection_by_name(
&self,
collection: CollectionName
) -> Result<(), Error>;
fn query_by_name(
&self,
view: &ViewName,
key: Option<QueryKey<Bytes>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Result<Vec<Serialized, Global>, Error>;
fn query_by_name_with_docs(
&self,
view: &ViewName,
key: Option<QueryKey<Bytes>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Result<MappedSerializedDocuments, Error>;
fn reduce_by_name(
&self,
view: &ViewName,
key: Option<QueryKey<Bytes>>,
access_policy: AccessPolicy
) -> Result<Vec<u8, Global>, Error>;
fn reduce_grouped_by_name(
&self,
view: &ViewName,
key: Option<QueryKey<Bytes>>,
access_policy: AccessPolicy
) -> Result<Vec<MappedSerializedValue, Global>, Error>;
fn delete_docs_by_name(
&self,
view: &ViewName,
key: Option<QueryKey<Bytes>>,
access_policy: AccessPolicy
) -> Result<u64, Error>;
fn insert<C, PrimaryKey, B>(
&self,
id: Option<PrimaryKey>,
contents: B
) -> Result<CollectionHeader<<C as Collection>::PrimaryKey>, Error>
where
C: Collection,
PrimaryKey: Send + for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
B: Into<Bytes> + Send,
{ ... }
fn update<C, D>(&self, doc: &mut D) -> Result<(), Error>
where
C: Collection,
D: Document<C> + Send + Sync,
{ ... }
fn overwrite<C, PrimaryKey>(
&self,
id: PrimaryKey,
contents: Vec<u8, Global>
) -> Result<CollectionHeader<<C as Collection>::PrimaryKey>, Error>
where
C: Collection,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
{ ... }
fn get<C, PrimaryKey>(
&self,
id: PrimaryKey
) -> Result<Option<OwnedDocument>, Error>
where
C: Collection,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
{ ... }
fn get_multiple<C, PrimaryKey, DocumentIds, I>(
&self,
ids: DocumentIds
) -> Result<Vec<OwnedDocument, Global>, Error>
where
C: Collection,
DocumentIds: IntoIterator<Item = PrimaryKey, IntoIter = I> + Send + Sync,
I: Iterator<Item = PrimaryKey> + Send + Sync,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
{ ... }
fn list<C, R, PrimaryKey>(
&self,
ids: R,
order: Sort,
limit: Option<u32>
) -> Result<Vec<OwnedDocument, Global>, Error>
where
C: Collection,
R: Into<Range<PrimaryKey>> + Send,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
{ ... }
fn list_headers<C, R, PrimaryKey>(
&self,
ids: R,
order: Sort,
limit: Option<u32>
) -> Result<Vec<Header, Global>, Error>
where
C: Collection,
R: Into<Range<PrimaryKey>> + Send,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
{ ... }
fn count<C, R, PrimaryKey>(&self, ids: R) -> Result<u64, Error>
where
C: Collection,
R: Into<Range<PrimaryKey>> + Send,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
{ ... }
fn delete<C, H>(&self, doc: &H) -> Result<(), Error>
where
C: Collection,
H: HasHeader + Send + Sync,
{ ... }
fn query<V, Key>(
&self,
key: Option<QueryKey<Key>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Result<Vec<Map<<V as View>::Key, <V as View>::Value>, Global>, Error>
where
V: SerializedView,
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
{ ... }
fn query_with_docs<V, Key>(
&self,
key: Option<QueryKey<Key>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Result<MappedDocuments<OwnedDocument, V>, Error>
where
V: SerializedView,
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
{ ... }
fn query_with_collection_docs<V, Key>(
&self,
key: Option<QueryKey<Key>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Result<MappedDocuments<CollectionDocument<<V as View>::Collection>, V>, Error>
where
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
V: SerializedView,
<V as View>::Collection: SerializedCollection,
<<V as View>::Collection as SerializedCollection>::Contents: Debug,
{ ... }
fn reduce<V, Key>(
&self,
key: Option<QueryKey<Key>>,
access_policy: AccessPolicy
) -> Result<<V as View>::Value, Error>
where
V: SerializedView,
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
{ ... }
fn reduce_grouped<V, Key>(
&self,
key: Option<QueryKey<Key>>,
access_policy: AccessPolicy
) -> Result<Vec<MappedValue<<V as View>::Key, <V as View>::Value>, Global>, Error>
where
V: SerializedView,
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
{ ... }
fn delete_docs<V, Key>(
&self,
key: Option<QueryKey<Key>>,
access_policy: AccessPolicy
) -> Result<u64, Error>
where
V: SerializedView,
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
{ ... }
}
Expand description
The low-level interface to a database’s schema::Schema
, giving access to
Collection
s and
Views
s. This trait is not safe to use within async
contexts and will block the current thread. For async access, use
AsyncLowLevelConnection
.
This trait’s methods are not designed for ergonomics. See
Connection
for a higher-level interface.
Required Methods§
fn apply_transaction(
&self,
transaction: Transaction
) -> Result<Vec<OperationResult, Global>, Error>
fn apply_transaction(
&self,
transaction: Transaction
) -> Result<Vec<OperationResult, Global>, Error>
Applies a Transaction
to the schema::Schema
. If any operation in the
Transaction
fails, none of the operations will be applied to the
schema::Schema
.
fn get_from_collection(
&self,
id: DocumentId,
collection: &CollectionName
) -> Result<Option<OwnedDocument>, Error>
fn get_from_collection(
&self,
id: DocumentId,
collection: &CollectionName
) -> Result<Option<OwnedDocument>, Error>
Retrieves the document with id
stored within the named collection
.
This is a lower-level API. For better ergonomics, consider using one of:
fn get_multiple_from_collection(
&self,
ids: &[DocumentId],
collection: &CollectionName
) -> Result<Vec<OwnedDocument, Global>, Error>
fn get_multiple_from_collection(
&self,
ids: &[DocumentId],
collection: &CollectionName
) -> Result<Vec<OwnedDocument, Global>, Error>
Retrieves all documents matching ids
from the named collection
.
Documents that are not found are not returned, but no error will be
generated.
This is a lower-level API. For better ergonomics, consider using one of:
fn list_from_collection(
&self,
ids: Range<DocumentId>,
order: Sort,
limit: Option<u32>,
collection: &CollectionName
) -> Result<Vec<OwnedDocument, Global>, Error>
fn list_from_collection(
&self,
ids: Range<DocumentId>,
order: Sort,
limit: Option<u32>,
collection: &CollectionName
) -> Result<Vec<OwnedDocument, Global>, Error>
Retrieves all documents within the range of ids
from the named
collection
. To retrieve all documents, pass in ..
for ids
.
This is a lower-level API. For better ergonomics, consider using one of:
fn list_headers_from_collection(
&self,
ids: Range<DocumentId>,
order: Sort,
limit: Option<u32>,
collection: &CollectionName
) -> Result<Vec<Header, Global>, Error>
fn list_headers_from_collection(
&self,
ids: Range<DocumentId>,
order: Sort,
limit: Option<u32>,
collection: &CollectionName
) -> Result<Vec<Header, Global>, Error>
Retrieves all headers within the range of ids
from the named
collection
. To retrieve all documents, pass in ..
for ids
.
This is a lower-level API. For better ergonomics, consider using one of:
fn count_from_collection(
&self,
ids: Range<DocumentId>,
collection: &CollectionName
) -> Result<u64, Error>
fn count_from_collection(
&self,
ids: Range<DocumentId>,
collection: &CollectionName
) -> Result<u64, Error>
Counts the number of documents within the range of ids
from the named
collection
.
This is a lower-level API. For better ergonomics, consider using one of:
fn compact_collection_by_name(
&self,
collection: CollectionName
) -> Result<(), Error>
fn compact_collection_by_name(
&self,
collection: CollectionName
) -> Result<(), Error>
Compacts the collection to reclaim unused disk space.
This process is done by writing data to a new file and swapping the file once the process completes. This ensures that if a hardware failure, power outage, or crash occurs that the original collection data is left untouched.
Errors
Error::CollectionNotFound
: databasename
does not exist.Error::Io
: an error occurred while compacting the database.
fn query_by_name(
&self,
view: &ViewName,
key: Option<QueryKey<Bytes>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Result<Vec<Serialized, Global>, Error>
fn query_by_name(
&self,
view: &ViewName,
key: Option<QueryKey<Bytes>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Result<Vec<Serialized, Global>, Error>
Queries for view entries from the named view
.
This is a lower-level API. For better ergonomics, consider querying the
view using self.view::<View>().query()
instead. The
parameters for the query can be customized on the builder returned from
Connection::view()
.
fn query_by_name_with_docs(
&self,
view: &ViewName,
key: Option<QueryKey<Bytes>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Result<MappedSerializedDocuments, Error>
fn query_by_name_with_docs(
&self,
view: &ViewName,
key: Option<QueryKey<Bytes>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Result<MappedSerializedDocuments, Error>
Queries for view entries from the named view
with their source
documents.
This is a lower-level API. For better ergonomics, consider querying the
view using
self.view::<View>().query_with_docs()
instead. The parameters for the query can be customized on the builder
returned from Connection::view()
.
fn reduce_by_name(
&self,
view: &ViewName,
key: Option<QueryKey<Bytes>>,
access_policy: AccessPolicy
) -> Result<Vec<u8, Global>, Error>
fn reduce_by_name(
&self,
view: &ViewName,
key: Option<QueryKey<Bytes>>,
access_policy: AccessPolicy
) -> Result<Vec<u8, Global>, Error>
Reduces the view entries from the named view
.
This is a lower-level API. For better ergonomics, consider reducing the
view using self.view::<View>().reduce()
instead. The parameters for the query can be customized on the builder
returned from Connection::view()
.
fn reduce_grouped_by_name(
&self,
view: &ViewName,
key: Option<QueryKey<Bytes>>,
access_policy: AccessPolicy
) -> Result<Vec<MappedSerializedValue, Global>, Error>
fn reduce_grouped_by_name(
&self,
view: &ViewName,
key: Option<QueryKey<Bytes>>,
access_policy: AccessPolicy
) -> Result<Vec<MappedSerializedValue, Global>, Error>
Reduces the view entries from the named view
, reducing the values by each
unique key.
This is a lower-level API. For better ergonomics, consider reducing
the view using
self.view::<View>().reduce_grouped()
instead.
The parameters for the query can be customized on the builder returned
from Connection::view()
.
fn delete_docs_by_name(
&self,
view: &ViewName,
key: Option<QueryKey<Bytes>>,
access_policy: AccessPolicy
) -> Result<u64, Error>
fn delete_docs_by_name(
&self,
view: &ViewName,
key: Option<QueryKey<Bytes>>,
access_policy: AccessPolicy
) -> Result<u64, Error>
Deletes all source documents for entries that match within the named
view
.
This is a lower-level API. For better ergonomics, consider querying the
view using
self.view::<View>().delete_docs()
instead. The parameters for the query can be customized on the builder
returned from Connection::view()
.
Provided Methods§
fn insert<C, PrimaryKey, B>(
&self,
id: Option<PrimaryKey>,
contents: B
) -> Result<CollectionHeader<<C as Collection>::PrimaryKey>, Error>where
C: Collection,
PrimaryKey: Send + for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
B: Into<Bytes> + Send,
fn insert<C, PrimaryKey, B>(
&self,
id: Option<PrimaryKey>,
contents: B
) -> Result<CollectionHeader<<C as Collection>::PrimaryKey>, Error>where
C: Collection,
PrimaryKey: Send + for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
B: Into<Bytes> + Send,
Inserts a newly created document into the connected schema::Schema
for the Collection
C
. If id
is None
a unique id will be
generated. If an id is provided and a document already exists with that
id, a conflict error will be returned.
This is the lower-level API. For better ergonomics, consider using one of:
fn update<C, D>(&self, doc: &mut D) -> Result<(), Error>where
C: Collection,
D: Document<C> + Send + Sync,
fn update<C, D>(&self, doc: &mut D) -> Result<(), Error>where
C: Collection,
D: Document<C> + Send + Sync,
Updates an existing document in the connected schema::Schema
for the
Collection
C
. Upon success, doc.revision
will be updated with
the new revision.
This is the lower-level API. For better ergonomics, consider using one of:
fn overwrite<C, PrimaryKey>(
&self,
id: PrimaryKey,
contents: Vec<u8, Global>
) -> Result<CollectionHeader<<C as Collection>::PrimaryKey>, Error>where
C: Collection,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
fn overwrite<C, PrimaryKey>(
&self,
id: PrimaryKey,
contents: Vec<u8, Global>
) -> Result<CollectionHeader<<C as Collection>::PrimaryKey>, Error>where
C: Collection,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
Overwrites an existing document, or inserts a new document. Upon success,
doc.revision
will be updated with the new revision information.
This is the lower-level API. For better ergonomics, consider using one of:
fn get<C, PrimaryKey>(
&self,
id: PrimaryKey
) -> Result<Option<OwnedDocument>, Error>where
C: Collection,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
fn get<C, PrimaryKey>(
&self,
id: PrimaryKey
) -> Result<Option<OwnedDocument>, Error>where
C: Collection,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
Retrieves a stored document from Collection
C
identified by id
.
This is a lower-level API. For better ergonomics, consider using one of:
fn get_multiple<C, PrimaryKey, DocumentIds, I>(
&self,
ids: DocumentIds
) -> Result<Vec<OwnedDocument, Global>, Error>where
C: Collection,
DocumentIds: IntoIterator<Item = PrimaryKey, IntoIter = I> + Send + Sync,
I: Iterator<Item = PrimaryKey> + Send + Sync,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
fn get_multiple<C, PrimaryKey, DocumentIds, I>(
&self,
ids: DocumentIds
) -> Result<Vec<OwnedDocument, Global>, Error>where
C: Collection,
DocumentIds: IntoIterator<Item = PrimaryKey, IntoIter = I> + Send + Sync,
I: Iterator<Item = PrimaryKey> + Send + Sync,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
Retrieves all documents matching ids
. Documents that are not found are
not returned, but no error will be generated.
This is a lower-level API. For better ergonomics, consider using one of:
fn list<C, R, PrimaryKey>(
&self,
ids: R,
order: Sort,
limit: Option<u32>
) -> Result<Vec<OwnedDocument, Global>, Error>where
C: Collection,
R: Into<Range<PrimaryKey>> + Send,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
fn list<C, R, PrimaryKey>(
&self,
ids: R,
order: Sort,
limit: Option<u32>
) -> Result<Vec<OwnedDocument, Global>, Error>where
C: Collection,
R: Into<Range<PrimaryKey>> + Send,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
Retrieves all documents within the range of ids
. To retrieve all
documents, pass in ..
for ids
.
This is a lower-level API. For better ergonomics, consider using one of:
fn list_headers<C, R, PrimaryKey>(
&self,
ids: R,
order: Sort,
limit: Option<u32>
) -> Result<Vec<Header, Global>, Error>where
C: Collection,
R: Into<Range<PrimaryKey>> + Send,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
fn list_headers<C, R, PrimaryKey>(
&self,
ids: R,
order: Sort,
limit: Option<u32>
) -> Result<Vec<Header, Global>, Error>where
C: Collection,
R: Into<Range<PrimaryKey>> + Send,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
Retrieves all documents within the range of ids
. To retrieve all
documents, pass in ..
for ids
.
This is the lower-level API. For better ergonomics, consider using one of:
fn count<C, R, PrimaryKey>(&self, ids: R) -> Result<u64, Error>where
C: Collection,
R: Into<Range<PrimaryKey>> + Send,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
fn count<C, R, PrimaryKey>(&self, ids: R) -> Result<u64, Error>where
C: Collection,
R: Into<Range<PrimaryKey>> + Send,
PrimaryKey: for<'k> KeyEncoding<'k, <C as Collection>::PrimaryKey>,
Counts the number of documents within the range of ids
.
This is a lower-level API. For better ergonomics, consider using one of:
fn delete<C, H>(&self, doc: &H) -> Result<(), Error>where
C: Collection,
H: HasHeader + Send + Sync,
fn delete<C, H>(&self, doc: &H) -> Result<(), Error>where
C: Collection,
H: HasHeader + Send + Sync,
Removes a Document
from the database.
This is a lower-level API. For better ergonomics, consider using one of:
fn query<V, Key>(
&self,
key: Option<QueryKey<Key>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Result<Vec<Map<<V as View>::Key, <V as View>::Value>, Global>, Error>where
V: SerializedView,
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
fn query<V, Key>(
&self,
key: Option<QueryKey<Key>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Result<Vec<Map<<V as View>::Key, <V as View>::Value>, Global>, Error>where
V: SerializedView,
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
Queries for view entries matching View
.
This is a lower-level API. For better ergonomics, consider querying the
view using self.view::<View>().query()
instead. The
parameters for the query can be customized on the builder returned from
Connection::view()
.
fn query_with_docs<V, Key>(
&self,
key: Option<QueryKey<Key>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Result<MappedDocuments<OwnedDocument, V>, Error>where
V: SerializedView,
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
fn query_with_docs<V, Key>(
&self,
key: Option<QueryKey<Key>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Result<MappedDocuments<OwnedDocument, V>, Error>where
V: SerializedView,
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
Queries for view entries matching View
with their source documents.
This is a lower-level API. For better ergonomics, consider querying
the view using self.view::<View>().query_with_docs()
instead.
The parameters for the query can be customized on the builder returned
from Connection::view()
.
fn query_with_collection_docs<V, Key>(
&self,
key: Option<QueryKey<Key>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Result<MappedDocuments<CollectionDocument<<V as View>::Collection>, V>, Error>where
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
V: SerializedView,
<V as View>::Collection: SerializedCollection,
<<V as View>::Collection as SerializedCollection>::Contents: Debug,
fn query_with_collection_docs<V, Key>(
&self,
key: Option<QueryKey<Key>>,
order: Sort,
limit: Option<u32>,
access_policy: AccessPolicy
) -> Result<MappedDocuments<CollectionDocument<<V as View>::Collection>, V>, Error>where
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
V: SerializedView,
<V as View>::Collection: SerializedCollection,
<<V as View>::Collection as SerializedCollection>::Contents: Debug,
Queries for view entries matching View
with their source documents, deserialized.
This is a lower-level API. For better ergonomics, consider querying
the view using self.view::<View>().query_with_collection_docs()
instead.
The parameters for the query can be customized on the builder returned
from Connection::view()
.
fn reduce<V, Key>(
&self,
key: Option<QueryKey<Key>>,
access_policy: AccessPolicy
) -> Result<<V as View>::Value, Error>where
V: SerializedView,
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
fn reduce<V, Key>(
&self,
key: Option<QueryKey<Key>>,
access_policy: AccessPolicy
) -> Result<<V as View>::Value, Error>where
V: SerializedView,
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
Reduces the view entries matching View
.
This is a lower-level API. For better ergonomics, consider reducing
the view using self.view::<View>().reduce()
instead.
The parameters for the query can be customized on the builder returned
from Connection::view()
.
fn reduce_grouped<V, Key>(
&self,
key: Option<QueryKey<Key>>,
access_policy: AccessPolicy
) -> Result<Vec<MappedValue<<V as View>::Key, <V as View>::Value>, Global>, Error>where
V: SerializedView,
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
fn reduce_grouped<V, Key>(
&self,
key: Option<QueryKey<Key>>,
access_policy: AccessPolicy
) -> Result<Vec<MappedValue<<V as View>::Key, <V as View>::Value>, Global>, Error>where
V: SerializedView,
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
Reduces the view entries matching View
, reducing the values by each
unique key.
This is a lower-level API. For better ergonomics, consider reducing
the view using
self.view::<View>().reduce_grouped()
instead.
The parameters for the query can be customized on the builder returned
from Connection::view()
.
fn delete_docs<V, Key>(
&self,
key: Option<QueryKey<Key>>,
access_policy: AccessPolicy
) -> Result<u64, Error>where
V: SerializedView,
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
fn delete_docs<V, Key>(
&self,
key: Option<QueryKey<Key>>,
access_policy: AccessPolicy
) -> Result<u64, Error>where
V: SerializedView,
Key: for<'k> KeyEncoding<'k, <V as View>::Key>,
Deletes all of the documents associated with this view.
This is a lower-level API. For better ergonomics, consider querying the
view using
self.view::<View>().delete_docs()
instead. The parameters for the query can be customized on the builder
returned from Connection::view()
.