Skip to content

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 authentication service in Vulcan is the Custom JWT authentication. Authenticating via JWT requires the audience field in the jwt payload to be defined and matching in your MongoDB Atlas app services configurations.

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 name mostly an identifier within the Codedraw board.
  • the description.
  • the DB Name the actual name of your db. This will be set to your configuration file.