Last updated
Last updated
By default, a DB
object is exposed when the CloudCode task is invoked.
To access a different deployment within the same app or a different app, a new DB object can be created:
Accessing other apps with different data models
If you try to use this to access another app's DB, make sure to use createRemoteDB
and not createDB
. Otherwise, you'll get errors like TypeError: Cannot read property 'where' of undefined
APIv4 can be accessed directly using fetch
. To avoid hardcoding APIv4 credentials, the details of the current deployment are exposed on the task: