Skip to content

Commit c894f77

Browse files
Mohammad Hunan ChughtaiMohammad Hunan Chughtai
Mohammad Hunan Chughtai
and
Mohammad Hunan Chughtai
authored
(DOCSP-15613): Added Node.js field types (#1041)
* Added node.js field types * fixed wording * fixed typo * fix typo in mdn urls * added additional data types * fix monospace err Co-authored-by: Mohammad Hunan Chughtai <[email protected]>
1 parent 9054308 commit c894f77

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed
+14-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
11
.. _node-data-types-field-types:
22

3-
=========================
4-
Field Types - Node.js SDK
5-
=========================
6-
3+
========================
4+
Field Types -Node.js SDK
5+
========================
76
.. default-domain:: mongodb
8-
97
.. contents:: On this page
108
:local:
119
:backlinks: none
1210
:depth: 2
1311
:class: singlecol
1412

15-
1613
{+client-database+} supports the following field data types:
14+
15+
- ``bool`` maps to the JavaScript :mdn:`Boolean <Web/JavaScript/Reference/Global_Objects/Boolean>` type
16+
- ``int`` maps to the JavaScript :mdn:`Number <Web/JavaScript/Reference/Global_Objects/Number>` type. Internally {+client-database+} stores ``int`` with 64 bits.
17+
- ``float`` maps to the JavaScript :mdn:`Number <Web/JavaScript/Reference/Global_Objects/Number>` type. Internally {+client-database+} stores ``float`` with 32 bits.
18+
- ``double`` maps to the JavaScript :mdn:`Number <Web/JavaScript/Reference/Global_Objects/Number>` type. Internally {+client-database+} stores ``double`` with 64 bits.
19+
- ``string`` maps to the JavaScript :mdn:`String <Web/JavaScript/Reference/Global_Objects/Boolean>` type.
20+
- ``decimal128`` for high precision numbers.
21+
- ``objectId`` maps to BSON :manual:`ObjectId </reference/method/ObjectId/>` type.
22+
- ``data`` maps to the JavaScript :mdn:`ArrayBuffer <Web/JavaScript/Reference/Global_Objects/ArrayBuffer>` type.
23+
- ``date`` maps to the JavaScript :mdn:`Date <Web/JavaScript/Reference/Global_Objects/Date>` type.
24+
- ``list`` maps to the JavaScript :mdn:`Array <Web/JavaScript/Reference/Global_Objects/Array>` type. You can also specify that a field contains a list of a primitive value type by appending ``[]`` to the type name.

0 commit comments

Comments
 (0)