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
48
48
49
49
A BSON binary ``binData`` value is a byte array. A ``binData`` value
50
50
has a subtype that indicates how to interpret the binary data. The
51
- following table shows the subtypes.
51
+ following table shows the subtypes:
52
52
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
87
54
88
55
.. _document-bson-type-object-id:
89
56
.. _objectid:
Original file line number Diff line number Diff line change @@ -33,52 +33,27 @@ Creates a binary data object.
33
33
34
34
* - ``sub_type``
35
35
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
58
37
59
- * - 3
38
+ - The :ref:`binary subtype <binData-subtype>`
60
39
61
- - OLD UUID
62
-
63
- * - 4
64
-
65
- - UUID
66
-
67
- * - 5
40
+ * - ``buffer``
68
41
69
- - MD5
42
+ - string
70
43
71
- * - 128
44
+ - The buffer object containing binary data. Must be a base 64
45
+ encoded string value.
72
46
73
- - User defined
47
+ :returns: A binary data object.
74
48
75
- * - ``buffer``
49
+ .. _binData-subtype:
76
50
77
- - string
51
+ Binary Subtypes
52
+ ~~~~~~~~~~~~~~~
78
53
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``:
80
55
81
- :returns: A binary data object.
56
+ .. include:: /includes/ binary-subtypes.rst
82
57
83
58
Examples
84
59
--------
@@ -136,4 +111,4 @@ The returned value is:
136
111
.. code-block:: javascript
137
112
:copyable: false
138
113
139
- 16
114
+ 16
You can’t perform that action at this time.
0 commit comments