Working with 2.x services
Legacy compatibility mode is strictly intended as a temporary stopgap solution for supporting existing services whileand is not a permanent feature of ArangoDB or Foxx. It is consideredas deprecated from v3.4.0 on.
In order to mark an existing service as a legacy service,make sure the following attribute is defined in the service manifest:
This semantic version range denotes that the serviceis known to work with ArangoDB 2.8.0 and supports all newer versions ofArangoDB up to but not including 3.0.0 and later.
Legacy compatibility mode supports the old manifest format, specifically:
main
is ignoredcontrollers
will be mounted as in 2.8exports
will be executed as in 2.8
Additionally the isSystem
attribute will be ignored if present butdoes not result in a warning in legacy compatibility mode.
The Foxx console is available as the console
pseudo-global variable(shadowing the global console object).
path()
is an alias for 3.xfileName()
(usingpath.join
to build file paths)fileName()
behaves as in 2.x (usingfs.safeJoin
to build file paths)- is an alias for 2.x
fileName
version
exposes the service manifest’sversion
attributename
exposes the service manifest’sname
attribute
The following methods are removed on the service context in legacy compatibility mode:
use()
– use@arangodb/foxx/controller
insteadapiDocumentation()
– usecontroller.apiDocumentation()
insteadregisterType()
– not supported in legacy compatibility mode
The following modules that have been removed or replaced in 3.0.0 areavailable in legacy compatibility mode:
@arangodb/foxx/authentication
@arangodb/foxx/console
@arangodb/foxx/controller
@arangodb/foxx/model
@arangodb/foxx/query
@arangodb/foxx/repository
@arangodb/foxx/sessions
@arangodb/foxx/template_middleware
The @arangodb/foxx
module also provides the same exports as in 2.8, namely:
Controller
from@arangodb/foxx/controller
createQuery
from@arangodb/foxx/query
Model
from@arangodb/foxx/model
Repository
from@arangodb/foxx/repository
toJSONSchema
from@arangodb/foxx/schema
getExports
andrequireApp
from@arangodb/foxx/manager
queues
from
Additionally, please note the differences laid out in the chapter on in the migration guide.