You guys are not the first to use Lumen with MongoDB. You even can continue using Eloquent ORM for creating your queries. There are some implementations on Github which are providing a solution to this.
Here is one way to do it (this solution is provided by https://hackernoon.com/how-to-use-mongodb-with-your-lumen-api-e13f36fa0aa6, check the link for more details):
1) Install https://github.com/jenssegers/laravel-mongodb with composer
2) Register the service provider in bootstrap/app.php:
$app->register(Jenssegers\Mongodb\MongodbServiceProvider::class);
$app->withEloquent();
3) Create config/database.php and add PHP:
return [
'default' => 'mongodb',
'connections' => [
'mongodb' => [
'driver' => ‘mongodb',
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', 27017),
'database' => env('DB_DATABASE'),
'username' => env('DB_USERNAME'),
'password' => env('DB_PASSWORD'),
'options' => [
'database' => 'admin' // sets the authentication database required by mongo 3
]
],
],
‘migrations’ => ‘migrations’,
];
4) Now you can use MongoDB within your .env file:
DB_CONNECTION=mongodb
DB_HOST=<dbHost>
DB_PORT=27017
DB_DATABASE=<dbName>
DB_USERNAME=<dbUser>
DB_PASSWORD=<dbUserPassword>
An alternative solution probably would be the Moloquent library: https://github.com/moloquent/moloquent