Migrating from pre-2.8
In a file /routes/examples.js
(relative to the root folder of the service):
require('./my-module')
will be attempted to be resolved in the following order:/routes/my-module
(relative to service root)/routes/my-module.json
(relative to service root)/routes/my-module/index.js
(relative to service root)/routes/my-module/index.json
(relative to service root)
-
/routes/node_modules/lodash
(relative to service root)/node_modules/lodash
(relative to service root)- Node compatibility module
- Bundled NPM module
lodash
require('/abs/path')
will be attempted to be resolved in the following order:/abs/path
(relative to file system root)/abs/path.js
(relative to file system root)/abs/path.json
(relative to file system root)/abs/path/index.json
(relative to file system root)This behavior is incompatible with the source code generated by the Foxx generator in the web interface before ArangoDB 2.8.
Note: The org/arangodb
module is aliased to the new name @arangodb
in ArangoDB 3.0.0 and the @arangodb
module was aliased to the old name org/arangodb
in ArangoDB 2.8.0. Either one will work in 2.8 and 3.0 but outside of legacy services you should use going forward.
ArangoDB 3.0 no longer provides built-in support for CoffeeScript source files, even in legacy compatibility mode. If you want to use an alternative language like CoffeeScript, make sure to pre-compile the raw source files to JavaScript and use the compiled JavaScript files in the service.
The @arangodb/request
module when used with the json
option previously overwrote the string in the body
property of the response object of the response with the parsed JSON body. In 2.8 this was changed so the parsed JSON body is added as the json
property of the response object in addition to overwriting the body
property. In 3.0 and later (including legacy compatibility mode) the body
property is no longer overwritten and must use the json
property instead. Note that this only affects code using the json
option when making the request.
The utility module lodash
is now available and should be used instead of underscore
, but both modules will continue to be provided.