Appearance
MongoDB
The MongoDB block is another storage type block. It's a fully cloud managed MongoDB instance. This article will explain some relevant implementation details in the Codedraw core.
Authentication
MongoDB Atlas supports different kinds of authentication. Currently the only implemented authentications service in Codedraw are:
- Custom JWT authentication. Authenticating via JWT requires the
audiencefield in the jwt payload to be defined and matching in your MongoDB Atlas app services configurations. - Api Key authentication.
Opening a connection
The InstallMongoDBGateway middleware will perform the authentication and open a connection to your database instance. The object is saved as a context variable and will be available across the app via:
typescript
const dataGateway = context.get('dataGateway')!New Authentication methods and integration features will be released with updated SDK versions.
When editing a MongoDB block you can set:
- the
namemostly an identifier within the Codedraw board. - the
description. - the
DB Namethe actual name of your db. This will be set to your configuration file.