Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RUST-1603 Support the authorized_collections option #1033

Merged
merged 2 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/action/list_collections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,12 @@ pub struct ListCollections<'a, M = ListSpecifications, S = ImplicitSession> {
session: S,
}

impl<'a, M> ListCollections<'a, M> {
impl<'a, M, S> ListCollections<'a, M, S> {
kevinAlbs marked this conversation as resolved.
Show resolved Hide resolved
option_setters!(options: ListCollectionsOptions;
filter: Document,
batch_size: u32,
comment: Bson,
authorized_collections: bool,
);
}

Expand Down
6 changes: 6 additions & 0 deletions src/db/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ pub struct ListCollectionsOptions {

/// Filters the list operation.
pub filter: Option<Document>,

/// When `true` and used with
/// [`list_collection_names`](crate::Database::list_collection_names), the command returns
/// only those collections for which the user has privileges. When used with
/// [`list_collections`](crate::Database::list_collections) this option has no effect.
pub authorized_collections: Option<bool>,
kevinAlbs marked this conversation as resolved.
Show resolved Hide resolved
}

/// Specifies the options to a [`Client::list_databases`](crate::Client::list_databases) operation.
Expand Down