File tree Expand file tree Collapse file tree 3 files changed +54
-73
lines changed Expand file tree Collapse file tree 3 files changed +54
-73
lines changed Original file line number Diff line number Diff line change 1+ .. list-table ::
2+ :header-rows: 1
3+
4+ * - Number
5+ - Description
6+
7+ * - 0
8+ - Generic binary subtype
9+
10+ * - 1
11+ - Function data
12+
13+ * - 2
14+ - Binary (old)
15+
16+ * - 3
17+ - UUID (old)
18+
19+ * - 4
20+ - UUID
21+
22+ * - 5
23+ - MD5
24+
25+ * - 6
26+ - Encrypted BSON value
27+
28+ * - 7
29+ - Compressed time series data
30+
31+ .. versionadded :: 5.2
32+
33+ * - 8
34+ - Sensitive data, such as a key or secret. MongoDB does not log
35+ literal values for binary data with subtype 8. Instead, MongoDB
36+ logs a placeholder value of ``### ``.
37+
38+ * - 128
39+ - Custom data
Original file line number Diff line number Diff line change @@ -48,42 +48,9 @@ Binary Data
4848
4949A BSON binary ``binData`` value is a byte array. A ``binData`` value
5050has a subtype that indicates how to interpret the binary data. The
51- following table shows the subtypes.
51+ following table shows the subtypes:
5252
53- .. list-table::
54- :header-rows: 1
55-
56- * - Number
57- - Subtype
58-
59- * - 0
60- - Generic binary subtype
61-
62- * - 1
63- - Function data
64-
65- * - 2
66- - Binary (old)
67-
68- * - 3
69- - UUID (old)
70-
71- * - 4
72- - UUID
73-
74- * - 5
75- - MD5
76-
77- * - 6
78- - Encrypted BSON value
79-
80- * - 7
81- - Compressed time series data
82-
83- .. versionadded:: 5.2
84-
85- * - 128
86- - Custom data
53+ .. include:: /includes/binary-subtypes.rst
8754
8855.. _document-bson-type-object-id:
8956.. _objectid:
Original file line number Diff line number Diff line change @@ -33,52 +33,27 @@ Creates a binary data object.
3333
3434 * - ``sub_type``
3535
36- - string
37-
38- - The binary type.
39-
40- .. list-table::
41- :header-rows: 1
42- :widths: 40 60
43-
44- * - Subtype
45- - Description
46-
47- * - 0
48-
49- - Generic binary subtype
50-
51- * - 1
52-
53- - Function
54-
55- * - 2
56-
57- - Byte Array
36+ - integer
5837
59- * - 3
38+ - The :ref:`binary subtype <binData-subtype>`
6039
61- - OLD UUID
62-
63- * - 4
64-
65- - UUID
66-
67- * - 5
40+ * - ``buffer``
6841
69- - MD5
42+ - string
7043
71- * - 128
44+ - The buffer object containing binary data. Must be a base 64
45+ encoded string value.
7246
73- - User defined
47+ :returns: A binary data object.
7448
75- * - ``buffer``
49+ .. _binData-subtype:
7650
77- - string
51+ Binary Subtypes
52+ ~~~~~~~~~~~~~~~
7853
79- - The buffer object containing binary data, must be a base 64 encoded string value.
54+ Specify one of the following values for ``sub_type``:
8055
81- :returns: A binary data object.
56+ .. include:: /includes/ binary-subtypes.rst
8257
8358Examples
8459--------
@@ -136,4 +111,4 @@ The returned value is:
136111.. code-block:: javascript
137112 :copyable: false
138113
139- 16
114+ 16
You can’t perform that action at this time.
0 commit comments