Skip to content

Commit

Permalink
(DOCSP-15613): Added Node.js field types (#1041)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
Mohammad Hunan Chughtai and Mohammad Hunan Chughtai authored May 11, 2021
1 parent 9054308 commit c894f77
Showing 1 changed file with 14 additions and 6 deletions.
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.

0 comments on commit c894f77

Please sign in to comment.