1MONGOC_DATABASE_ADD_USER(3) libmongoc MONGOC_DATABASE_ADD_USER(3)
2
3
4
6 bool
7 mongoc_database_add_user (mongoc_database_t *database,
8 const char *username,
9 const char *password,
10 const bson_t *roles,
11 const bson_t *custom_data,
12 bson_error_t *error);
13
15 • database: A mongoc_database_t.
16
17 • username: The name of the user.
18
19 • password: The cleartext password for the user.
20
21 • roles: An optional bson_t for roles.
22
23 • custom_data: A optional bson_t for extra data.
24
25 • error: A location for a bson_error_t or NULL.
26
27 This function shall create a new user with access to database.
28
29 WARNING:
30 Do not call this function without TLS.
31
33 Errors are returned through the error parameter and can include socket
34 or other server side failures.
35
37 Returns true if the user was successfully added. Returns false and sets
38 error if there are invalid arguments or a server or network error.
39
41 MongoDB, Inc
42
44 2017-present, MongoDB, Inc
45
46
47
48
491.25.1 Nov 08, 2023 MONGOC_DATABASE_ADD_USER(3)