SchemaFilter (config option)
- Last Updated: October 28, 2020
- 2 minute read
- DataDirect Connectors
- ODBC
- MongoDB 8.0
- Documentation
Attribute
SchemaFilter
Purpose
Specifies a comma-separated list of database and collection pairs for which you want the driver to fetch metadata. SchemaFilter can significantly improve connection times by limiting the collections for which metadata is fetched to only those that are required by your application. If you do not specify a value, the driver fetches metadata for all the collections in every database that your account has access to, which can adversely impact performance during the initial connection to a database.
Valid Values
database_name:collection_name[[,database_name:collection_name]...]
where:
database_name- is a literal value or regular expression for the database that contains collections for which the driver fetches metadata.
collection_name- is a literal value or regular expression of the collection for which the driver fetches metadata.
- A literal name that does not contain either a comma ( , ) or a colon ( : )
- A literal name that contains a comma ( , ) or a colon ( : ) that is
bounded by a slash ( / ) at the beginning and end. For example, a collection named
sales:2019would be represented by/sales:2019/ - A regular expression bounded by a slash ( / ) at the beginning and end,
such as
/sales.*\d/ - An asterisk ( * ), which represents all databases or collections within the corresponding schema(s).
The value for this config option is specified as a key=value pair in the Config Options field. See "Config options" for details.
Examples
- Literal values: The following example returns
metadata for only the
novemberandmarchcollections in theoem_salesdatabase.SchemaFilter=oem_sales:november,oem_sales:march - Wildcard values: If you want the driver to
fetch metadata for all the tables in a schema, replace the value for the table or schema
name with an * (wildcard) character. For
example, the following returns metadata for all the tables in the
oem_salesand for tables namedcustomersin all databases.SchemaFilter=oem_sales:*,*:customers - Partial wildcard values: You can also use the
asterisk to specify partial values for databases and collections. For example, the
following returns metadata for all tables in the that end with
regionthat are in schemas that begin withsales.SchemaFilter=/sales.*/:/.*region/ -
Regular expressions: The following returns metadata for tables named
taxin all databases that start withyearwhich end with a number.SchemaFilter=*/year.*\d/:tax
Default
NoneGUI Tab
For Windows:
The value for config options are specified in the Config Options field on the Advanced tab.
For UNIX/Linux:
The value for config options are specified in the Config Options field on the Schema Tool. For details, see "Starting the Schema Tool on UNIX/Linux."