Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions source/sdk/node/data-types/field-types.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
.. _node-data-types-field-types:

=========================
Field Types - Node.js SDK
=========================

========================
Field Types -Node.js SDK
========================
.. default-domain:: mongodb

.. contents:: On this page
:local:
:backlinks: none
:depth: 2
:class: singlecol


{+client-database+} supports the following field data types:

- ``bool`` maps to the JavaScript :mdn:`Boolean <Web/JavaScript/Reference/Global_Objects/Boolean>` type
- ``int`` maps to the JavaScript :mdn:`Number <Web/JavaScript/Reference/Global_Objects/Number>` type. Internally {+client-database+} stores ``int`` with 64 bits.
- ``float`` maps to the JavaScript :mdn:`Number <Web/JavaScript/Reference/Global_Objects/Number>` type. Internally {+client-database+} stores ``float`` with 32 bits.
- ``double`` maps to the JavaScript :mdn:`Number <Web/JavaScript/Reference/Global_Objects/Number>` type. Internally {+client-database+} stores ``double`` with 64 bits.
- ``string`` maps to the JavaScript :mdn:`String <Web/JavaScript/Reference/Global_Objects/Boolean>` type.
- ``decimal128`` for high precision numbers.
- ``objectId`` maps to BSON :manual:`ObjectId </reference/method/ObjectId/>` type.
- ``data`` maps to the JavaScript :mdn:`ArrayBuffer <Web/JavaScript/Reference/Global_Objects/ArrayBuffer>` type.
- ``date`` maps to the JavaScript :mdn:`Date <Web/JavaScript/Reference/Global_Objects/Date>` type.
- ``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.