BI Connector 是否有云托管版本?
您可以在 MongoDB Atlas 中托管 MongoDB Connector for Business Intelligence。要了解如何启用和连接到 Atlas 托管的 BI Connector,请参阅通过 BI Connector for Atlas 连接。
如何使用 BI Connector 进行身份验证?
Changed in version 2.0:
在版本 2.0 之前,BI Connector 单独存储一组凭证。
如果您使用的是旧版本的 MongoDB Connector for BI,则应按照本地安装 BI Connector 中的步骤升级到 2.0。
使用身份验证连接到 MongoDB 部署时,您可以以该部署中配置的用户和角色进行身份验证。
有关如何指定身份验证来源和机制的详细信息,请参阅身份验证。
升级 MongoDB 时,BI Connector 应注意哪些事项?
Before upgrading your MongoDB deployment, set the --mongo-versionCompatibility option to the currently installed major release series of MongoDB, for example 3.4. Once the upgrade is complete, restart mongosqld without the --mongo-versionCompatibility option or set it to the newly updated major release series.
注意
如果使用DRDL 模式文件启动 BI Connector,并且开始使用新引入的BSON 类型,则必须在升级后更新模式文件。
MongoDB3.4 引入十进制BSON类型。当您从MongoDB. 32升级到MongoDB.3 4且模式文件包含float64 double值(映射到MongoDB中的 类型)时,您必须在开始使用新的decimal 类型。
BI Connector 是否存储任何数据?
BI Connector 实例仅将 SQL 查询转换为 MongoDB 查询。 它本身不存储任何数据。
如何处理查询?
BI Connector 会构造聚合表达式。
mongosqld always enables the aggregate allowDiskUse option.
BI Connector 无法将某些支持的 SQL 构造映射到等效聚合。 在这种情况下,BI Connector 将在内存中执行这些构造。
如何跳过与 DRDL 类型定义不兼容的数据?
使用 MongoDB 视图
MongoDB 3.4引入了只读视图,可用于筛选不兼容的数据。
例如,您可以在test grade数据库中创建一个视图,该视图仅包含包含collection的grades 字段中的数字的文档:
db.runCommand( { create: "numericGrades", viewOn: "grades", pipeline: [ { "$match": { "grade": { "$type": "number" } } } ] } )
然后,您可以使用mongodrdl从该视图生成模式,就像生成collection一样:
mongodrdl -d test -c numericGrades
使用 DRDL 筛选器
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.
例如,要仅匹配grade字段中包含数字的文档,请使用以下管道阶段:
"$match": { "grade": { "$type": "number" } }
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.
提示
我是否可以将 MongoDB 视图与 BI Connector 结合使用?
是的。 BI Connector 将视图视为任何其他集合。 有关在 BI Connector 中使用视图的更多信息,请参阅使用 MongoDB 视图管理模式。
是否有适用于 DRDL 的语法验证工具?
DRDL 文件使用 YAML 语法。任何 YAML 验证器,例如 https://yaml-online-parser.appspot.com/可以帮助您检查 DRDL 文件。
BI Connector 如何处理日期?
The BI Connector will correctly process BSON date data by mapping it to the SQL datetime type. For example:
db.data.save({ date: new Date() })
如果将日期数据存储为字符串,BI Connector 会将其视为字符串而不是日期。 例如,BI Connector 将以下内容视为字符串:
db.data.save({ date: '32-FEB-2015' })
如何将 TLS/SSL 与 BI Connector 结合使用?
mongosqld和 MongoDB 部署之间的连接与 SQL 客户端和mongosqld之间的连接分开配置了 TLS/SSL。
将 mongosqld 连接到MongoDB
If the MongoDB instance you are connecting to uses TLS/SSL, provide the --mongo-ssl option to mongosqld.
例如:
mongosqld --schema=schema.drdl --mongo-ssl
要指定 TLS/SSL CA 根证书,请使用--mongo-sslCAFile选项。 要指定客户端证书,请使用--mongo-sslPEMKeyFile选项。 例如:
mongosqld --schema=schema.drdl \ --mongo-ssl \ --mongo-sslCAFile=/certs/ca.pem \ --mongo-sslPEMKeyFile=/certs/mongodb_client.pem
将客户端连接到 mongosqld
要指定 TLS/SSL CA 根证书,请使用--sslCAFile选项。 要指定客户端证书,请使用--sslPEMKeyFile选项。 例如:
mongosqld --schema=schema.drdl \ --sslCAFile=/certs/ca.pem \ --sslPEMKeyFile=/certs/mongosql_server.pem
我可以使用SQL EXPLAIN 函数吗?
If you are using an SQL client which allows you to issue SQL statements directly, such as the MySQL shell, you can precede any query with EXPLAIN to get information about how the query will be executed. EXPLAIN returns the complete aggregation operation which BI Connector will send to MongoDB, without running the query or returning any results. EXPLAIN is useful if you want to know exactly how a specific SQL query translates into MongoDB Query Language.