1BSON_APPEND_CODE_WITH_SCOPE(3)      libbson     BSON_APPEND_CODE_WITH_SCOPE(3)
2
3
4

NAME

6       bson_append_code_with_scope - bson_append_code_with_scope()
7

SYNOPSIS

9          #define BSON_APPEND_CODE_WITH_SCOPE(b, key, val, scope) \
10             bson_append_code_with_scope (b, key, (int) strlen (key), val, scope)
11
12          bool
13          bson_append_code_with_scope (bson_t *bson,
14                                       const char *key,
15                                       int key_length,
16                                       const char *javascript,
17                                       const bson_t *scope);
18

PARAMETERS

20bson: A bson_t.
21
22key: An ASCII C string containing the name of the field.
23
24key_length: The length of key in bytes, or -1 to determine the length
25         with strlen().
26
27javascript: A NULL-terminated UTF-8  encoded  string  containing  the
28         javascript fragment.
29
30scope: Optional bson_t containing the scope for javascript.
31

DESCRIPTION

33       The  bson_append_code_with_scope() function shall perform like bson_ap‐
34       pend_code() except it allows providing a scope to the javascript  func‐
35       tion in the form of a bson document.
36
37       If  scope  is  NULL,  this  function  appends an element with BSON type
38       "code", otherwise with BSON type "code with scope".
39

RETURNS

41       Returns true if the operation was applied  successfully.  The  function
42       will  fail  if  appending  javascript  and scope grows bson larger than
43       INT32_MAX.
44

AUTHOR

46       MongoDB, Inc
47
49       2017-present, MongoDB, Inc
50
51
52
53
541.20.0                           Nov 18, 2021   BSON_APPEND_CODE_WITH_SCOPE(3)
Impressum