init method
Subclasses must implement this to initialize the datastore.
Implementation
@override
Future<void> init() async {
// Specified in digial ocean's environment settings:
// https://docs.digitalocean.com/products/app-platform/how-to/use-environment-variables/#define-build-time-environment-variables
final mongoUrl = Platform.environment['DATABASE_URL'];
if (mongoUrl == null) {
throw Exception('DATABASE_URL environment variable is not set.');
}
db = await mongo.Db.create(mongoUrl);
await db.open();
}