MongoDB is a noSQL or document database. QIE's database connections are based on SQL and using a standard JDBC driver for connecting to the SQL server. Because of this, you can't connect to the MongoDB database using the QIE database connection configuration.
To connect to MongoDB using QIE, you would first need to download the mongodb java libraries with any required dependencies and place them in the libs directory so that the classes become avaible to the QIE service. This can be done by following these steps.
Once you have the libraries installed, you will need to write a custom script that manually creates a new connection object, and then uses it to query the database using the noSQL options available from the driver itself.
Doing a search for the MongDB JDBC driver does show that there are some options that might work. Many of them require you to purchase the driver, and other don't. I can't speak to the usability or relyability of those drivers.
Here is an example of how you would connect to "testEMR" MongoDB and then get the values from the Patient collection:
var mongoClient = com.mongodb.client.MongoClients.create("<<MongoDB URI>>");
var database = mongoClient.getDatabase("testEMR");
var mongoCollection = database.getCollection("Patient");
var collectionArray = mongoCollection.find().iterator();
while (collectionArray.hasNext()) {
var doc = collectionArray.next();
qie.debug(doc.toJson());
}