1MONGOC_COLLECTION_RENAME_WITH_OPTS(3l)ibmongMoOcNGOC_COLLECTION_RENAME_WITH_OPTS(3)
2
3
4

SYNOPSIS

6          bool
7          mongoc_collection_rename_with_opts (mongoc_collection_t *collection,
8                                              const char *new_db,
9                                              const char *new_name,
10                                              bool drop_target_before_rename,
11                                              const bson_t *opts,
12                                              bson_error_t *error);
13

PARAMETERS

15collection: A mongoc_collection_t.
16
17new_db: The name of the new database.
18
19new_name: The new name for the collection.
20
21drop_target_before_rename:  If an existing collection matches the new
22         name, drop it before the rename.
23
24error: An optional location for a bson_error_t or NULL.
25
26       opts may be NULL or a BSON document with additional command options:
27
28writeConcern:   Construct   a    mongoc_write_concern_t    and    use
29         mongoc_write_concern_append()  to  add the write concern to opts. See
30         the example code for mongoc_client_write_command_with_opts().
31
32sessionId:   First,   construct   a   mongoc_client_session_t    with
33         mongoc_client_start_session().  You  can  begin  a  transaction  with
34         mongoc_client_session_start_transaction(),    optionally    with    a
35         mongoc_transaction_opt_t  that  overrides  the options inherited from
36         collection, and use mongoc_client_session_append() to add the session
37         to opts. See the example code for mongoc_client_session_t.
38
39serverId:  To  target  a specific server, include an int32 "serverId"
40         field. Obtain the id by calling  mongoc_client_select_server(),  then
41         mongoc_server_description_id() on its return value.
42

DESCRIPTION

44       This function is a helper to rename an existing collection on a MongoDB
45       server. The name of the collection will also be updated  internally  so
46       it  is  safe  to continue using this collection after the rename. Addi‐
47       tional operations will occur on renamed collection.
48
49       If no write concern is provided in opts, the collection's write concern
50       is used.
51

ERRORS

53       Errors are propagated via the error parameter.
54

RETURNS

56       Returns  true  if successful. Returns false and sets error if there are
57       invalid arguments or a server or network error.
58

AUTHOR

60       MongoDB, Inc
61
63       2017-present, MongoDB, Inc
64
65
66
67
681.25.1                           Nov 08, 2M0O2N3GOC_COLLECTION_RENAME_WITH_OPTS(3)
Impressum