1BSON_APPEND_REGEX_W_LEN(3) libbson BSON_APPEND_REGEX_W_LEN(3)
2
3
4
6 bson_append_regex_w_len - bson_append_regex_w_len()
7
9 bool
10 bson_append_regex_w_len (bson_t *bson,
11 const char *key,
12 int key_length,
13 const char *regex,
14 int regex_length,
15 const char *options);
16
18 • bson: A bson_t.
19
20 • key: An ASCII C string containing the name of the field.
21
22 • key_length: The length of key in bytes, or -1 to determine the length
23 with strlen().
24
25 • regex: An ASCII string containing the regex.
26
27 • regex_length: The length of regex in bytes, or -1 to determine the
28 length with strlen().
29
30 • options: An optional string containing the regex options as a string.
31
33 Appends a new field to bson of type BSON_TYPE_REGEX. regex should be
34 the regex string. options should contain the options for the regex.
35
36 Valid characters for options include:
37
38 • 'i' for case-insensitive.
39
40 • 'm' for multiple matching.
41
42 • 'x' for verbose mode.
43
44 • 'l' to make w and W locale dependent.
45
46 • 's' for dotall mode ('.' matches everything)
47
48 • 'u' to make w and W match unicode.
49
51 Returns true if the operation was applied successfully. The function
52 will fail if appending the regex grows bson larger than INT32_MAX.
53
55 MongoDB, Inc
56
58 2017-present, MongoDB, Inc
59
60
61
62
631.20.0 Nov 18, 2021 BSON_APPEND_REGEX_W_LEN(3)