SYNOPSIS

bool
mongoc_database_add_user (mongoc_database_t *database,
                          const char        *username,
                          const char        *password,
                          const bson_t      *roles,
                          const bson_t      *custom_data,
                          bson_error_t      *error);

bool
mongoc_database_remove_user (mongoc_database_t *database,
                             const char        *username,
                             bson_error_t      *error);

DESCRIPTION

The mongoc_database_add_user() function shall create a new user with access to database.

username

a non-optional string holding the username

password

an optional string holding the password

roles

an optional bson_t of roles

custom_data

an optional bson_t of custom data to store

error

an optional error pointer to store any error data

RETURN VALUE

The mongoc_database_add_user() function returns true if the user was successfully added. In the event of an error it returns false an error is set.

ERRORS

Errors are returned through error and may vary based on the server version.

SEE ALSO

AUTHORS

This page was written by MongoDB Inc.