This example provides an Action Item with a Lua script to point local data stores to a different Mongodb instance.


The example can be loaded from a Console Display in DataStudio with the following simple Lua code:

local exm = require('esi-examples')
In Lua Security Mode Restrictive, for the installation script as well as the actual example to work, additional configuration of Lua permissions is required. See Lua Security for background information and examples.

The code above will create a folder structure "Examples/Remote Mongodb" underneath the Core object in I/O Model. In this folder will be a single, disabled Action Item named "Repoint Data Stores". This Action Item contains a Lua script body that illustrates how to repoint the several of the standard data stores to a different standalone Mongodb server.

  • Note: Only "simple" standalone connections are supported - no security settings, no encryption, no replica sets!

Using the Remote Mongodb

Before using the action item, edit its Lua script body to provide the name, FQDN or IP address of the target Mongodb server and the port of the remote Mongodb instance:

Remote Mongodb

Once the changes have been applied, enabling the Action item will immediately trigger the reconfiguration of the current system inmation instance.