Closed dreamsbond closed 5 years ago
Limoncello uses DBAL to work with databases. A list of supported databases by DBAL is here. Thus, if you have MongoDB installed you can either use it directly or with a wrapper such as Doctrine MongoDB.
Technically, it would be better to place either of them to the application container as shown here and use it anywhere in the app.
For example,
class MongoDbConfigurator implements ContainerConfiguratorInterface
{
public static function configureContainer(LimoncelloContainerInterface $container): void
{
$container[\MongoDB\Driver\Manager::class] = function (PsrContainerInterface $container) {
// read MongoDB settings (e.g. connect string and etc)
$settings = $container->get(SettingsProviderInterface::class)->get(\Settings\MongoDB::class);
// create MongoDB connection with settings
return new \MongoDB\Driver\Manager(...);
};
}
}
Thanks!
Curious if limoncello supports mongoDB.