FAQ: The MongoDB Connector for BI¶
On this page
- Is there a cloud-hosted version of the MongoDB Connector for BI?
- How do I authenticate with the MongoDB Connector for BI?
- Does the MongoDB Connector for BI store any data?
- How are queries processed?
- 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/SSL with the MongoDB Connector for BI?
Is there a cloud-hosted version of the MongoDB Connector for BI?¶
A cloud-hosted MongoDB Connector for BI is now available in MongoDB Atlas. For more information on connecting to an Atlas-hosted BI Connector, see Connect via Atlas BI Connector.
How do I authenticate with the MongoDB Connector for BI?¶
Changed in version 2.0: Prior to version 2.0, the MongoDB Connector for BI stored its own separate set of credentials.
If you are using an older release of the MongoDB Connector for BI, you should upgrade to 2.0 by following the steps in Install BI Connector On Premises.
When connecting to a MongoDB deployment using authentication, you can authenticate as the users and roles configured in that deployment.
See Authentication for details on how to specify your authentication source and mechanism.
Does the MongoDB Connector for BI store any data?¶
The MongoDB Connector for BI instance only transforms SQL queries into MongoDB queries. It does not store any data itself.
When starting mongosqld
, you provide it a
DRDL file describing the schema of your
data.
How are queries processed?¶
The MongoDB Connector for BI constructs an aggregation pipeline that allows the MongoDB server to execute many SQL expressions.
mongosqld
always enables the
aggregate allowDiskUse
option.
The MongoDB Connector for BI cannot map some supported SQL constructs into an aggregation equivalent. In this case, the MongoDB Connector for BI will execute those constructs in memory.
How do I skip data incompatible with my DRDL type definition?¶
Using MongoDB 3.4 Views¶
MongoDB 3.4 introduces Read-Only Views that you can use to filter incompatible data.
For example, you can create a view in the test
database that contains
only documents containing a number in the grade
field of a grades
collection:
You can then use mongodrdl
to generate a schema from this view
as you would a collection:
Using a DRDL Filter¶
If documents in a collection contain different data types for a field,
you may 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:
If you store date data as a string, the MongoDB Connector for BI treats it as a string rather than as a date. For example, MongoDB Connector for BI treats the following as a string:
How do I use TLS/SSL with the MongoDB Connector for BI?¶
The connection between mongosqld
and your MongoDB deployment
has TLS/SSL configured separately from the connection between your MySQL
client and mongosqld
.
Connecting mongosqld
to MongoDB¶
If the MongoDB instance you are connecting to uses
TLS/SSL, provide
the --mongo-ssl
option to mongosqld
.
For example:
To specify a TLS/SSL CA root certificate, use the --mongo-sslCAFile
option. To specify a client certificate, use the --mongo-sslPEMKeyFile
option. For example:
Connecting a client to mongosqld
¶
To specify a TLS/SSL CA root certificate, use the --sslCAFile
option. To specify a client certificate, use the --sslPEMKeyFile
option. For example: