Connecting

Login to Knowi and select Settings -> Datasources from the left down menu.

Click on MongoDB. Either follow the prompts to set up connectivity to your own MongoDB database, or, use the pre-configured settings into Cloud9 Chart's own demo MongoDB database.

When connecting from the UI directly to your MongoDB database, please follow the connectivity instructions to allow Knowi to access your database.

Alternatively, if you connecting through an agent, check Internal Datasource to assign it to your agent. The agent (running inside your network) will synchronize it automatically. Alternatively, configure datasource and queries directly into agent.

Database Properties allow for extra control on the data coming back from the Mongo datasource. For example:

Mongo Data Sampling Control LimitsTo control how much data to sample in order to get the field list populated:

schemaSample: How many rows (most recent) we will retrieve from the collection.schemaNestedSample: if the retrieved rows contain nested field, how many nested entries we will sample.

4. Save the Connection. Click on the "Configure Queries" link on the success bar.

Queries & Reports

Set up Query to preview and execute.

Report Name: Specify a name for the report.

Query Generator: Queries can be auto-generated using our Data Discovery & Query Generator feature. For more complex use cases, or if you are using the agent, you can also enter/override MongoDB queries directly (and optionally post-process them with Cloud9QL).

If you're using the Knowi demo MongoDB database, click 'Preview' to see the results.

The queries can be run directly against your database real-time when the dashboards are loaded by checking the Direct Query option. Alternatively, you can also store the results seamlessly into our warehouse along with more advanced ways of incrementally tracking the data. This enables fast visualizations on long running queries as well as an intermediary layer for reporting queries of your data. If the warehousing option is used, configure how often it should be updated.

Overwrite Strategy (for scheduled query runs):

Overwrite Strategies determines how the data is stored in Knowi:

i. If empty, data will be added on to the existing data for this dataset within Knowi. Or,

ii. "All": Any existing data for this dataset will be replaced by this results.

iii. One or More Field Names (Example: "A,B,C"): A new record is created where the values of the combination of the field names do not exist, and, updates current records for the field grouping where it exists. For example, if this is set to say "Date, Type", existing data with the same Date and Type values will be updated with the latest data, and new records created when they do not exist.

Click 'Preview' to see the results.

Click on 'Save' to complete setting up the report. This also sets up this data extraction on a schedule, if configured.

Click on 'Dashboards' link on the success bar to access dashboards. You can drag and drop the newly created report from the widget list into to the dashboard.

Map-Reduce

Knowi supports Map-Reduce useful for pushing down processing of large datasets into MongoDB (beyond MongoDB's aggregate function). Map-Reduce support includes Map, Reduce, Finalize functions, and "limit" and "scope" parameters. Note that the output results must be returned inline.

For example, if you have a collection of events for each of customers with fields "customer" and "sent":

Cloud9Agent

As an alternative to the UI based connectivity above, you can use Cloud9Agent on stand-alone mode inside your network to pull from MongoDB. See Cloud9Agent to download your agent along with instructions to run it.

Optional cleansing/transformation of the results from the Mongo query using Cloud9QL. See Cloud9QL docs

frequencyType

One of minutes, hours, days,weeks,months. If this is not specified, this is treated as a one-time query, executed upon Cloud9Agent startup (or when the query is first saved)

frequency

Indicates the frequency if frequencyType is defined. For example, if this value is 10 and the frequencyType is minutes, the query will be executed every 10 minutes

startTime

Optional can be used to specify when the query should be run for the first time. If set, the frequency will be determined from that time onwards. For example, is a weekly run is scheduled to start at 07/01/2014 13:30, the first run will run on 07/01 at 13:30, with the next run at the same time on 07/08/2014. The time is based on the local time of the machine running the Agent. Supported Date Formats: MM/dd/yyyy HH:mm, MM/dd/yy HH:mm, MM/dd/yyyy, MM/dd/yy, HH:mm:ss,HH:mm,mm

overrideVals

This enables data storage strategies to be specified. If this is not defined, the results of the query are added to the existing dataset. To replace all data for this dataset within Knowi, specify {"replaceAll":true}. To upsert data specify "replaceValuesForKey":["fieldA","fieldB"]. This will replace all existing records in Knowi with the same fieldA and fieldB with the current data and insert records where they are not present.