We are currently developing some mapReduce scripts to run inside mongo using typescript. We are aware that mongodb does not support every es2020 feature and we are due to some restrictions not able to just compile down to es6 or something like that. We need to write typescriptcode that is not getting compiled down (target es6) but matches mongodb's ES-Featureset.
We tried to find documentation on which ECMAScript-Minimum mongodb guarantees but the docs just seems to ignore this topic or at least it is not that important to them.
Has anyone found continously updated documentation about this topic?
CodePudding user response:
There isn't a statement from MongoDB, Inc. on this. However, you can make a determination for yourself by looking at the source:
https://github.com/mongodb/mongo/tree/master/src/third_party/mozjs-60
Mongo uses SpiderMonkey, the JS runtime from Mozilla (used in Firefox). You can find some peripheral information about this at the following links:
Once you determine which version of SpiderMonkey is being used in the mongo build you are using, you can figure out from there which ES features are supported by it.