[−][src]Type Definition mongodb_h2co3::db::Database
type Database = Arc<DatabaseInner>;
Trait Implementations
impl ThreadedDatabase for Database
[src]
impl ThreadedDatabase for Database
fn open(
client: Client,
name: &str,
read_preference: Option<ReadPreference>,
write_concern: Option<WriteConcern>
) -> Database
[src]
fn open(
client: Client,
name: &str,
read_preference: Option<ReadPreference>,
write_concern: Option<WriteConcern>
) -> Database
Creates a database representation with optional read and write controls.
fn auth(&self, user: &str, password: &str) -> Result<()>
[src]
fn auth(&self, user: &str, password: &str) -> Result<()>
Logs in a user using the SCRAM-SHA-1 mechanism.
fn collection(&self, coll_name: &str) -> Collection
[src]
fn collection(&self, coll_name: &str) -> Collection
Creates a collection representation with inherited read and write controls.
fn collection_with_prefs(
&self,
coll_name: &str,
create: bool,
read_preference: Option<ReadPreference>,
write_concern: Option<WriteConcern>
) -> Collection
[src]
fn collection_with_prefs(
&self,
coll_name: &str,
create: bool,
read_preference: Option<ReadPreference>,
write_concern: Option<WriteConcern>
) -> Collection
Creates a collection representation with custom read and write controls.
fn get_req_id(&self) -> i32
[src]
fn get_req_id(&self) -> i32
Return a unique operational request id.
fn command_cursor(
&self,
spec: Document,
cmd_type: CommandType,
read_pref: ReadPreference
) -> Result<Cursor>
[src]
fn command_cursor(
&self,
spec: Document,
cmd_type: CommandType,
read_pref: ReadPreference
) -> Result<Cursor>
Generates a cursor for a relevant operational command.
fn command(
&self,
spec: Document,
cmd_type: CommandType,
read_preference: Option<ReadPreference>
) -> Result<Document>
[src]
fn command(
&self,
spec: Document,
cmd_type: CommandType,
read_preference: Option<ReadPreference>
) -> Result<Document>
Sends an administrative command over find_one.
fn list_collections(&self, filter: Option<Document>) -> Result<Cursor>
[src]
fn list_collections(&self, filter: Option<Document>) -> Result<Cursor>
Returns a list of collections within the database.
fn list_collections_with_batch_size(
&self,
filter: Option<Document>,
batch_size: i32
) -> Result<Cursor>
[src]
fn list_collections_with_batch_size(
&self,
filter: Option<Document>,
batch_size: i32
) -> Result<Cursor>
Returns a list of collections within the database with a custom batch size.
fn collection_names(&self, filter: Option<Document>) -> Result<Vec<String>>
[src]
fn collection_names(&self, filter: Option<Document>) -> Result<Vec<String>>
Returns a list of collection names within the database.
fn version(&self) -> Result<Version>
[src]
fn version(&self) -> Result<Version>
fn create_collection(
&self,
name: &str,
options: Option<CreateCollectionOptions>
) -> Result<()>
[src]
fn create_collection(
&self,
name: &str,
options: Option<CreateCollectionOptions>
) -> Result<()>
Creates a new collection. Read more
fn create_user(
&self,
name: &str,
password: &str,
options: Option<CreateUserOptions>
) -> Result<()>
[src]
fn create_user(
&self,
name: &str,
password: &str,
options: Option<CreateUserOptions>
) -> Result<()>
Creates a new user.
fn drop_all_users(&self, write_concern: Option<WriteConcern>) -> Result<i32>
[src]
fn drop_all_users(&self, write_concern: Option<WriteConcern>) -> Result<i32>
Permanently deletes all users from the database.
fn drop_collection(&self, name: &str) -> Result<()>
[src]
fn drop_collection(&self, name: &str) -> Result<()>
Permanently deletes the collection from the database.
fn drop_database(&self) -> Result<()>
[src]
fn drop_database(&self) -> Result<()>
Permanently deletes the database from the server.
fn drop_user(
&self,
name: &str,
write_concern: Option<WriteConcern>
) -> Result<()>
[src]
fn drop_user(
&self,
name: &str,
write_concern: Option<WriteConcern>
) -> Result<()>
Permanently deletes the user from the database.
fn get_all_users(&self, show_credentials: bool) -> Result<Vec<Document>>
[src]
fn get_all_users(&self, show_credentials: bool) -> Result<Vec<Document>>
Retrieves information about all users in the database.
fn get_user(
&self,
user: &str,
options: Option<UserInfoOptions>
) -> Result<Document>
[src]
fn get_user(
&self,
user: &str,
options: Option<UserInfoOptions>
) -> Result<Document>
Retrieves information about a given user from the database.
fn get_users(
&self,
users: Vec<&str>,
options: Option<UserInfoOptions>
) -> Result<Vec<Document>>
[src]
fn get_users(
&self,
users: Vec<&str>,
options: Option<UserInfoOptions>
) -> Result<Vec<Document>>
Retrieves information about a given set of users from the database.