FAQ: The MongoDB Connector for BI¶
On this page
- Does the MongoDB Connector for BI store any data?
- In what order does query processing happen?
- What SQL statements get pushed down to MongoDB?
- How do I skip data incompatible with my DRDL type definition?
- Is there any syntax validation tool for DRDL?
- How does the MongoDB Connector for BI process dates?
- How do I use TLS with the MongoDB Connector for BI?
- How do I use LDAP authentication with the MongoDB Connector for BI?
Does the MongoDB Connector for BI store any data?¶
No. The MongoDB Connector for BI is an interface into your MongoDB database. It stores only user
information and MongoDB connection string information
imparted by mongobiuser
, and the schema defined by a
DRDL file.
In what order does query processing happen?¶
Changed in version 1.1.1: The MongoDB Connector for BI now processes ORDER BY
clauses.
The MongoDB Connector for BI will process a query in the following order:
- The
$match
stage from a custom filter, - The aggregation pipeline from the DRDL file,
- Any
$match
stages from theWHERE
clause, - Any
$sort
stages from theORDER BY
clause, - The
$project
stage from theSELECT
clause.
What SQL statements get pushed down to MongoDB?¶
Changed in version 1.1.1: The MongoDB Connector for BI now pushes ORDER BY
clauses down to MongoDB.
The MongoDB Connector for BI will push SELECT
projection terms, WHERE
conditions including
the IN
operator, and the ORDER BY
clause down to MongoDB.
You can push JOIN
, GROUP BY
, and other clauses down to MongoDB
using the pipeline
field of your DRDL file and
custom filters.
How do I skip data incompatible with my DRDL type definition?¶
If documents in a collection contain different data types for a field, you may
wish to filter for a specific data type. To accomplish this, you can include a
$match
stage at the beginning of the pipeline in your
DRDL table definition.
For example, to match only documents containing a number in the grade
field,
use the following pipeline stage:
If you are unwinding
an array field that contains
different data types, then to filter the array for a specific data type, put
the $match
stage after the $unwind
.
See also
Is there any syntax validation tool for DRDL?¶
DRDL files use the YAML syntax. Any YAML validator such as https://yaml-online-parser.appspot.com/ can help you check your DRDL files.
How does the MongoDB Connector for BI process dates?¶
The MongoDB Connector for BI will correctly process BSON date data
by mapping it to the SQL datetime
type. For example:
However, if you store date data as a string, MongoDB Connector for BI will treat it as a string rather than as a date. For example, MongoDB Connector for BI will treat the following as a string:
How do I use TLS with the MongoDB Connector for BI?¶
If the MongoDB instance you are connecting to uses
SSL/TLS, you must use
the ssl=true
option in the
PyMongo connection string.
For example, when using mongobiuser
:
To specify a TLS CA root certificate, use the ssl_ca_certs
option. To
specify a client certificate, use the ssl_certfile
option. For example:
How do I use LDAP authentication with the MongoDB Connector for BI?¶
If you are connecting to a MongoDB instance that uses
LDAP for user authentication,
you must specify the authMechanism=PLAIN
and
authSource=$external
connection string options. For example:
Important
You must surround your connection string in single quotes, as in the example.
This prevents your shell from trying to expand $external
with an empty
string.