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

SYNOPSIS

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

PARAMETERS

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

DESCRIPTION

30       The   bson_append_code_with_scope()   function   shall   perform   like
31       bson_append_code() except it allows providing a scope to the javascript
32       function in the form of a bson document.
33
34       If  scope  is  NULL,  this  function  appends an element with BSON type
35       "code", otherwise with BSON type "code with scope".
36

RETURNS

38       Returns true if the operation was applied  successfully.  The  function
39       will  fail  if  appending  javascript  and scope grows bson larger than
40       INT32_MAX.
41

AUTHOR

43       MongoDB, Inc
44
46       2017-present, MongoDB, Inc
47
48
49
50
511.25.1                           Nov 08, 2023   BSON_APPEND_CODE_WITH_SCOPE(3)
Impressum