1BSON_CONTEXT_NEW(3) libbson BSON_CONTEXT_NEW(3)
2
3
4
6 bson_context_new - bson_context_new()
7
9 bson_context_t *
10 bson_context_new (bson_context_flags_t flags);
11
13 • flags: A bson_context_flags_t.
14
15 The following flags may be used: * BSON_CONTEXT_NONE meaning creating
16 ObjectIDs with this context is not a thread-safe operation. *
17 BSON_CONTEXT_DISABLE_PID_CACHE meaning creating ObjectIDs will also
18 check if the process has changed by calling getpid() on every ObjectID
19 generation.
20
21 The following flags are deprecated and have no effect:
22
23 • BSON_CONTEXT_DISABLE_HOST_CACHE
24
25 • BSON_CONTEXT_THREAD_SAFE
26
27 • BSON_CONTEXT_USE_TASK_ID
28
30 Creates a new bson_context_t. This is rarely needed as bson_con‐
31 text_get_default() serves most use-cases.
32
34 A newly allocated bson_context_t that should be freed with bson_con‐
35 text_destroy.
36
38 MongoDB, Inc
39
41 2017-present, MongoDB, Inc
42
43
44
45
461.21.1 Mar 02, 2022 BSON_CONTEXT_NEW(3)