JavaScript Support
On this page
MongoDB Realm functions fully support JavaScript ES5 syntax as well as most modern JavaScript features included in EcmaScript 2015 (ES6) and more recent releases. They can also access most Node.js built-in modules.
Syntax
Feature | Supported |
---|---|
Yes | |
Yes | |
Yes | |
Yes | |
Yes | |
Yes | |
Yes | |
Yes | |
Yes | |
Yes | |
Yes | |
Yes | |
Yes | |
Yes | |
No | |
Yes |
Built-In Objects
Built-In Methods & Properties
Built-In Modules
You can import and use standard Node built-in modules in functions. MongoDB Realm supports most built-ins with either full or partial support. Some built-ins that are not suited for serverless workloads are not supported.
The supported modules and partially supported modules are compatible with Node API version 10.18.1. Avoid using APIs in these modules introduced after or deprecated since Node 10.18.1.
Fully Supported Modules
MongoDB Realm fully supports the following built-in modules:
Partially Supported Modules
MongoDB Realm supports a subset of the functionality of the following modules.
dgram

Realm supports the following dgram
APIs:
- socket.addMembership
- socket.address
- socket.bind
- socket.close
- createSocket
- socket.dropMembership
- socket.send
- socket.setBroadcast
- socket.setMulticastLoopback
- socket.setMulticastTTL
Realm does not support the following dgram
APIs:
dns
Realm supports the dns module with the following exceptions:
- Realm does not support the dns Promises API
- Realm does not support resolver.cancel()
fs
Realm supports the following fs
APIs:
http
, http/2
and https

Realm supports all of the http and https APIs except for the Server class functionality.
Similarly, Realm supports only the client-side APIs of http/2.
process

Realm supports the following process
APIs:
util

Realm supports the util module with the following exceptions:
- Realm does not support util.TextEncoder
- Realm does not support util.TextDecoder
crypto

Realm supports the crypto module with the following exceptions:
- Realm does not support crypto.createDiffieHellman()
- Realm does not support crypto.createDiffieHellmanGroup()
- Realm does not support crypto.createECDH()
Unsupported Modules
Realm functions do not support the following built-in modules:
child_process
cluster
domain
readline
v8
vm