<p>Here is the tutorial to write and build Lua application that can communicate with MongoDB database.</p>
At first, we need to install LuaRocks. Here is the tutorial.
We need to install dependency to access MongoDB database through Lua. Execute the command to install dependency:
luarocks install lua-mongo
Here is the link of document and its Github.
Below is the sample code to do MongoDB query. The file name is mongoDB.lua:
local mongo = require('mongo')
Then execute above lua script using following command: