From bf15ec2e532a5fcdff0d735a238d9aa99b5e7b7f Mon Sep 17 00:00:00 2001 From: Abhilasha Narendra Date: Fri, 25 Jun 2021 15:39:20 +0530 Subject: [PATCH] Fixing review comments Former-commit-id: 4e9bc30ea69632955685151a5efd73dde0f8d707 --- .../mongo_data_adapter/5.2.9/01_whats_new.mdx | 10 ++ .../04_installing_the_mongo_data_adapter.mdx | 10 +- .../05_updating_the_mongo_data_adapter.mdx | 4 +- .../5.2.9/06_features_of_mongo_fdw.mdx | 24 +-- .../07_configuring_the_mongo_data_adapter.mdx | 158 +++++++++--------- ...11_uninstalling_the_mongo_data_adapter.mdx | 4 +- 6 files changed, 109 insertions(+), 101 deletions(-) create mode 100644 product_docs/docs/mongo_data_adapter/5.2.9/01_whats_new.mdx diff --git a/product_docs/docs/mongo_data_adapter/5.2.9/01_whats_new.mdx b/product_docs/docs/mongo_data_adapter/5.2.9/01_whats_new.mdx new file mode 100644 index 00000000000..3ba10216617 --- /dev/null +++ b/product_docs/docs/mongo_data_adapter/5.2.9/01_whats_new.mdx @@ -0,0 +1,10 @@ +--- +title: "What’s New" +--- + + + +The following features are added to create MongoDB Foreign Data Wrapper `5.2.9`: + +- Updated mongo-c-driver to 1.17.3 +- Updated json-c to 0.15 diff --git a/product_docs/docs/mongo_data_adapter/5.2.9/04_installing_the_mongo_data_adapter.mdx b/product_docs/docs/mongo_data_adapter/5.2.9/04_installing_the_mongo_data_adapter.mdx index 9fe2ab8e364..5f94de4e76f 100644 --- a/product_docs/docs/mongo_data_adapter/5.2.9/04_installing_the_mongo_data_adapter.mdx +++ b/product_docs/docs/mongo_data_adapter/5.2.9/04_installing_the_mongo_data_adapter.mdx @@ -71,7 +71,7 @@ You can install the MongoDB Foreign Data Wrapper using an RPM package on the fol dnf install edb-as-mongo_fdw ``` - where `xx` is the server version number. + where `xx` is the server version number. @@ -108,7 +108,7 @@ You can install the MongoDB Foreign Data Wrapper using an RPM package on the fol dnf install edb-as-mongo_fdw ``` - where `xx` is the server version number. + where `xx` is the server version number. @@ -184,9 +184,7 @@ You can install the MongoDB Foreign Data Wrapper using an RPM package on the fol dnf install edb-as-mongo_fdw ``` - where `xx` is the server version number. - - + where `xx` is the server version number. @@ -290,4 +288,4 @@ The following steps will walk you through using the EDB apt repository to instal apt-get install edb-as-mongo-fdw ``` -where `xx` is the server version number. + where `xx` is the server version number. diff --git a/product_docs/docs/mongo_data_adapter/5.2.9/05_updating_the_mongo_data_adapter.mdx b/product_docs/docs/mongo_data_adapter/5.2.9/05_updating_the_mongo_data_adapter.mdx index a32e883b0bb..63a59b8c5ef 100644 --- a/product_docs/docs/mongo_data_adapter/5.2.9/05_updating_the_mongo_data_adapter.mdx +++ b/product_docs/docs/mongo_data_adapter/5.2.9/05_updating_the_mongo_data_adapter.mdx @@ -4,7 +4,7 @@ title: "Updating the MongoDB Foreign Data Wrapper" -**Updating an RPM Installation** +## Updating an RPM Installation If you have an existing RPM installation of MongoDB Foreign Data Wrapper, you can use yum or dnf to upgrade your repository configuration file and update to a more recent product version. To update the `edb.repo` file, assume superuser privileges and enter: @@ -36,7 +36,7 @@ yum or dnf will update the `edb.repo` file to enable access to the current EDB r where `xx` is the server version number. -**Updating MongoDB Foreign Data Wrapper on a Debian or Ubuntu Host** +## Updating MongoDB Foreign Data Wrapper on a Debian or Ubuntu Host To update MongoDB Foreign Data Wrapper on a Debian or Ubuntu Host, use the following command: diff --git a/product_docs/docs/mongo_data_adapter/5.2.9/06_features_of_mongo_fdw.mdx b/product_docs/docs/mongo_data_adapter/5.2.9/06_features_of_mongo_fdw.mdx index aec81845037..972cdcb480d 100644 --- a/product_docs/docs/mongo_data_adapter/5.2.9/06_features_of_mongo_fdw.mdx +++ b/product_docs/docs/mongo_data_adapter/5.2.9/06_features_of_mongo_fdw.mdx @@ -8,38 +8,38 @@ The key features of the MongoDB Foreign Data Wrapper are listed below: ## Writable FDW -The MongoDB Foreign Data Wrapper allows you to modify data on a MongoDB server. Users can `INSERT`, `UPDATE` and `DELETE` data in the remote MongoDB collections by inserting, updating and deleting data locally in foreign tables. See also: +The MongoDB Foreign Data Wrapper allows you to modify data on a MongoDB server. Users can `INSERT`, `UPDATE` and `DELETE` data in the remote MongoDB collections by inserting, updating and deleting data locally in foreign tables. -[Example: Using the MongoDB Foreign Data Wrapper](08_example_using_the_mongo_data_adapter/#example_using_the_mongo_data_adapter) +See also: -[Data Type Mappings](07_configuring_the_mongo_data_adapter/#data-type-mappings) +- [Example: Using the MongoDB Foreign Data Wrapper](08_example_using_the_mongo_data_adapter/#example_using_the_mongo_data_adapter) -## Where Clause Push-down +- [Data Type Mappings](07_configuring_the_mongo_data_adapter/#data-type-mappings) -MongoDB Foreign Data Wrapper allows the push-down of `WHERE` clause only when clauses include comparison expressions that have a column and a constant as arguments. WHERE clause push-down is not supported where constant is an array. +## WHERE Clause Push-down + +MongoDB Foreign Data Wrapper allows the push-down of the `WHERE` clause only when clauses include the comparison expressions that have a column and a constant as arguments. `WHERE` clause push-down is not supported where the constant is an array. ## Connection Pooling -Mongo_FDW establishes a connection to a foreign server during the first query that uses a foreign table associated with the foreign server. This connection is kept and reused for subsequent queries in the same session. +The MongoDB Foreign Data Wrapper establishes a connection to a foreign server during the first query that uses a foreign table associated with the foreign server. This connection is kept and reused for subsequent queries in the same session. ## Automated Cleanup The MongoDB Foreign Data Wrapper allows the cleanup of foreign tables in a single operation using the `DROP EXTENSION` command. This feature is especially useful when a foreign table has been created for a temporary purpose. The syntax of a `DROP EXTENSION` command is: -> `DROP EXTENSION mongo_fdw CASCADE;` + `DROP EXTENSION mongo_fdw CASCADE;` For more information, see [DROP EXTENSION](https://www.postgresql.org/docs/current/sql-dropextension.html). ## Full Document Retrieval -This feature allows to retrieve documents along with all their fields from collection without any knowledge of the fields in BSON document available in MongoDB's collection. Those retrieved documents are in the JSON format. +This feature allows you to retrieve documents along with all their fields from collection without any knowledge of the fields in the BSON document available in MongoDB's collection. Those retrieved documents are in JSON format. You can retrieve all available fields in a collection residing in MongoDB Foreign Data Wrapper as explained in the following example: **Example**: -The collection in MongoDB Foreign Data Wrapper: - ```text > db.warehouse.find(); { "_id" : ObjectId("58a1ebbaf543ec0b90545859"), "warehouse_id" : 1, "warehouse_name" : "UPS", "warehouse_created" : ISODate("2014-12-12T07:12:10Z") } @@ -48,13 +48,13 @@ The collection in MongoDB Foreign Data Wrapper: Steps for retrieving the document: -1. Create foreign table with a column name `__doc`. The type of the column could be json, jsonb, text or varchar. +1. Create foreign table with a column name `__doc`. The type of the column could be json, jsonb, text, or varchar. ```text CREATE FOREIGN TABLE test_json(__doc json) SERVER mongo_server OPTIONS (database 'testdb', collection 'warehouse'); ``` -1. Retrieve the document. +2. Retrieve the document. ```text SELECT * FROM test_json ORDER BY __doc::text COLLATE "C"; diff --git a/product_docs/docs/mongo_data_adapter/5.2.9/07_configuring_the_mongo_data_adapter.mdx b/product_docs/docs/mongo_data_adapter/5.2.9/07_configuring_the_mongo_data_adapter.mdx index b04ccf9e345..2a549faa7d5 100644 --- a/product_docs/docs/mongo_data_adapter/5.2.9/07_configuring_the_mongo_data_adapter.mdx +++ b/product_docs/docs/mongo_data_adapter/5.2.9/07_configuring_the_mongo_data_adapter.mdx @@ -6,10 +6,10 @@ title: "Configuring the MongoDB Foreign Data Wrapper" Before using the MongoDB Foreign Data Wrapper, you must: -> 1. Use the [CREATE EXTENSION](#create-extension) command to create the MongoDB Foreign Data Wrapper extension on the Postgres host. -> 2. Use the [CREATE SERVER](#create-server) command to define a connection to the MongoDB server. -> 3. Use the [CREATE USER MAPPING](#create-user-mapping) command to define a mapping that associates a Postgres role with the server. -> 4. Use the [CREATE FOREIGN TABLE](#create-foreign-table) command to define a table in the Postgres database that corresponds to a database that resides on the MongoDB cluster. + 1. Use the [CREATE EXTENSION](#create-extension) command to create the MongoDB Foreign Data Wrapper extension on the Postgres host. + 2. Use the [CREATE SERVER](#create-server) command to define a connection to the MongoDB server. + 3. Use the [CREATE USER MAPPING](#create-user-mapping) command to define a mapping that associates a Postgres role with the server. + 4. Use the [CREATE FOREIGN TABLE](#create-foreign-table) command to define a table in the Postgres database that corresponds to a database that resides on the MongoDB cluster. @@ -25,21 +25,21 @@ CREATE EXTENSION [IF NOT EXISTS] mongo_fdw [WITH] [SCHEMA schema_name]; `IF NOT EXISTS` -> Include the `IF NOT EXISTS` clause to instruct the server to issue a notice instead of throwing an error if an extension with the same name already exists. + Include the `IF NOT EXISTS` clause to instruct the server to issue a notice instead of throwing an error if an extension with the same name already exists. `schema_name` -> Optionally specify the name of the schema in which to install the extension's objects. + Optionally specify the name of the schema in which to install the extension's objects. **Example** The following command installs the MongoDB foreign data wrapper: -> `CREATE EXTENSION mongo_fdw;` + `CREATE EXTENSION mongo_fdw;` For more information about using the foreign data wrapper `CREATE EXTENSION` command, see: -> . + . @@ -58,15 +58,15 @@ The role that defines the server is the owner of the server; use the `ALTER SERV `server_name` -> Use `server_name` to specify a name for the foreign server. The server name must be unique within the database. + Use `server_name` to specify a name for the foreign server. The server name must be unique within the database. `FOREIGN_DATA_WRAPPER` -> Include the `FOREIGN_DATA_WRAPPER` clause to specify that the server should use the `mongo_fdw` foreign data wrapper when connecting to the cluster. + Include the `FOREIGN_DATA_WRAPPER` clause to specify that the server should use the `mongo_fdw` foreign data wrapper when connecting to the cluster. `OPTIONS` -> Use the `OPTIONS` clause of the `CREATE SERVER` command to specify connection information for the foreign server object. You can include: + Use the `OPTIONS` clause of the `CREATE SERVER` command to specify connection information for the foreign server object. You can include: | **Option** | **Description** | | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -74,12 +74,12 @@ The role that defines the server is the owner of the server; use the `ALTER SERV | port | The port number of the Mongo Server. Valid range is 0 to 65535. The default value is `27017`. | | authentication_database | The database against which user will be authenticated. This option is only valid with password based authentication. | | ssl | Requests an authenticated, encrypted SSL connection. By default, the value is set to `false`. Set the value to `true` to enable ssl. See to understand the options. | -| pem_file | SSL option | +| pem_file | SSL option. | | pem_pwd | SSL option. | -| ca_file | SSL option | -| ca_dir | SSL option | -| crl_file | SSL option | -| weak_cert_validation | SSL option | +| ca_file | SSL option. | +| ca_dir | SSL option. | +| crl_file | SSL option. | +| weak_cert_validation | SSL option. | **Example** @@ -93,7 +93,7 @@ The foreign server uses the default port (`27017`) for the connection to the cli For more information about using the `CREATE SERVER` command, see: -> + @@ -112,25 +112,25 @@ You must be the owner of the foreign server to create a user mapping for that se `role_name` -> Use `role_name` to specify the role that will be associated with the foreign server. + Use `role_name` to specify the role that will be associated with the foreign server. `server_name` -> Use `server_name` to specify the name of the server that defines a connection to the MongoDB cluster. + Use `server_name` to specify the name of the server that defines a connection to the MongoDB cluster. `OPTIONS` -> Use the `OPTIONS` clause to specify connection information for the foreign server. -> -> `username`: the name of the user on the MongoDB server. -> -> `password`: the password associated with the username. + Use the `OPTIONS` clause to specify connection information for the foreign server. + + `username`: the name of the user on the MongoDB server. + + `password`: the password associated with the username. **Example** The following command creates a user mapping for a role named `enterprisedb`; the mapping is associated with a server named `mongo_server`: -> `CREATE USER MAPPING FOR enterprisedb SERVER mongo_server;` + `CREATE USER MAPPING FOR enterprisedb SERVER mongo_server;` If the database host uses secure authentication, provide connection credentials when creating the user mapping: @@ -142,7 +142,7 @@ The command creates a user mapping for a role named `enterprisedb` that is assoc For detailed information about the `CREATE USER MAPPING` command, see: -> + @@ -177,57 +177,57 @@ and `table_constraint` is: `table_name` -> Specifies the name of the foreign table; include a schema name to specify the schema in which the foreign table should reside. + Specify the name of the foreign table; include a schema name to specify the schema in which the foreign table should reside. `IF NOT EXISTS` -> Include the `IF NOT EXISTS` clause to instruct the server to not throw an error if a table with the same name already exists; if a table with the same name exists, the server will issue a notice. + Include the `IF NOT EXISTS` clause to instruct the server to not throw an error if a table with the same name already exists; if a table with the same name exists, the server will issue a notice. `column_name` -> Specifies the name of a column in the new table; each column should correspond to a column described on the MongoDB server. + Specify the name of a column in the new table; each column should correspond to a column described on the MongoDB server. `data_type` -> Specifies the data type of the column; when possible, specify the same data type for each column on the Postgres server and the MongoDB server. If a data type with the same name is not available, the Postgres server will attempt to cast the data type to a type compatible with the MongoDB server. If the server cannot identify a compatible data type, it will return an error. + Specify the data type of the column; when possible, specify the same data type for each column on the Postgres server and the MongoDB server. If a data type with the same name is not available, the Postgres server will attempt to cast the data type to a type compatible with the MongoDB server. If the server cannot identify a compatible data type, it will return an error. `COLLATE collation` -> Include the `COLLATE` clause to assign a collation to the column; if not specified, the column data type's default collation is used. + Include the `COLLATE` clause to assign a collation to the column; if not specified, the column data type's default collation is used. `INHERITS (parent_table [, ... ])` -> Include the `INHERITS` clause to specify a list of tables from which the new foreign table automatically inherits all columns. Parent tables can be plain tables or foreign tables. + Include the `INHERITS` clause to specify a list of tables from which the new foreign table automatically inherits all columns. Parent tables can be plain tables or foreign tables. `CONSTRAINT constraint_name` -> Specify an optional name for a column or table constraint; if not specified, the server will generate a constraint name. + Specify an optional name for a column or table constraint; if not specified, the server will generate a constraint name. `NOT NULL` -> Include the `NOT NULL` keywords to indicate that the column is not allowed to contain null values. + Include the `NOT NULL` keywords to indicate that the column is not allowed to contain null values. `NULL` -> Include the `NULL` keywords to indicate that the column is allowed to contain null values. This is the default. + Include the `NULL` keywords to indicate that the column is allowed to contain null values. This is the default. `CHECK (expr) [NO INHERIT]` -> Use the `CHECK` clause to specify an expression that produces a Boolean result that each row in the table must satisfy. A check constraint specified as a column constraint should reference that column's value only, while an expression appearing in a table constraint can reference multiple columns. -> -> A `CHECK` expression cannot contain subqueries or refer to variables other than columns of the current row. -> -> Include the `NO INHERIT` keywords to specify that a constraint should not propagate to child tables. + Use the `CHECK` clause to specify an expression that produces a Boolean result that each row in the table must satisfy. A check constraint specified as a column constraint should reference that column's value only, while an expression appearing in a table constraint can reference multiple columns. + + A `CHECK` expression cannot contain subqueries or refer to variables other than columns of the current row. + + Include the `NO INHERIT` keywords to specify that a constraint should not propagate to child tables. `DEFAULT default_expr` -> Include the `DEFAULT` clause to specify a default data value for the column whose column definition it appears within. The data type of the default expression must match the data type of the column. + Include the `DEFAULT` clause to specify a default data value for the column whose column definition it appears within. The data type of the default expression must match the data type of the column. `SERVER server_name [OPTIONS (option 'value' [, ... ] ) ]` -> To create a foreign table that will allow you to query a table that resides on a MongoDB file system, include the `SERVER` clause and specify the `server_name` of the foreign server that uses the MongoDB data adapter. -> -> Use the `OPTIONS` clause to specify the following `options` and their corresponding values: + To create a foreign table that will allow you to query a table that resides on a MongoDB file system, include the `SERVER` clause and specify the `server_name` of the foreign server that uses the MongoDB data adapter. + + Use the `OPTIONS` clause to specify the following `options` and their corresponding values: | option | value | | ---------- | --------------------------------------------------------------------------------- | @@ -273,7 +273,7 @@ Include the `SERVER` clause to specify the name of the database stored on the Mo For more information about using the `CREATE FOREIGN TABLE` command, see: -> + !!! Note MongoDB foreign data wrapper supports the write capability feature. @@ -306,29 +306,29 @@ DROP EXTENSION [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]; `IF EXISTS` -> Include the `IF EXISTS` clause to instruct the server to issue a notice instead of throwing an error if an extension with the specified name doesn't exists. + Include the `IF EXISTS` clause to instruct the server to issue a notice instead of throwing an error if an extension with the specified name doesn't exists. `name` -> Specify the name of the installed extension. It is optional. -> -> `CASCADE` -> -> Automatically drop objects that depend on the extension. It drops all the other dependent objects too. -> -> `RESTRICT` -> -> Do not allow to drop extension if any objects, other than its member objects and extensions listed in the same DROP command are dependent on it. + Specify the name of the installed extension. It is optional. + + `CASCADE` + + Automatically drop objects that depend on the extension. It drops all the other dependent objects too. + + `RESTRICT` + + Do not allow to drop extension if any objects, other than its member objects and extensions listed in the same DROP command are dependent on it. **Example** The following command removes the extension from the existing database: -> `DROP EXTENSION mongo_fdw;` + `DROP EXTENSION mongo_fdw;` For more information about using the foreign data wrapper `DROP EXTENSION` command, see: -> . + . ## DROP SERVER @@ -344,29 +344,29 @@ The role that drops the server is the owner of the server; use the `ALTER SERVER `IF EXISTS` -> Include the `IF EXISTS` clause to instruct the server to issue a notice instead of throwing an error if a server with the specified name doesn't exists. + Include the `IF EXISTS` clause to instruct the server to issue a notice instead of throwing an error if a server with the specified name doesn't exists. `name` -> Specify the name of the installed server. It is optional. -> -> `CASCADE` -> -> Automatically drop objects that depend on the server. It should drop all the other dependent objects too. -> -> `RESTRICT` -> -> Do not allow to drop the server if any objects are dependent on it. + Specify the name of the installed server. It is optional. + + `CASCADE` + + Automatically drop objects that depend on the server. It should drop all the other dependent objects too. + + `RESTRICT` + + Do not allow to drop the server if any objects are dependent on it. **Example** The following command removes a foreign server named `mongo_server`: -> `DROP SERVER mongo_server;` + `DROP SERVER mongo_server;` For more information about using the `DROP SERVER` command, see: -> + ## DROP USER MAPPING @@ -380,25 +380,25 @@ DROP USER MAPPING [ IF EXISTS ] FOR { user_name | USER | CURRENT_USER | PUBLIC } `IF EXISTS` -> Include the `IF EXISTS` clause to instruct the server to issue a notice instead of throwing an error if the user mapping doesn't exist. + Include the `IF EXISTS` clause to instruct the server to issue a notice instead of throwing an error if the user mapping doesn't exist. `user_name` -> Specify the user name of the mapping. + Specify the user name of the mapping. `server_name` -> Specify the name of the server that defines a connection to the MongoDB cluster. + Specify the name of the server that defines a connection to the MongoDB cluster. **Example** The following command drops a user mapping for a role named `enterprisedb`; the mapping is associated with a server named `mongo_server`: -> `DROP USER MAPPING FOR enterprisedb SERVER mongo_server;` + `DROP USER MAPPING FOR enterprisedb SERVER mongo_server;` For detailed information about the `DROP USER MAPPING` command, see: -> + ## DROP FOREIGN TABLE @@ -412,19 +412,19 @@ DROP FOREIGN TABLE [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ] `IF EXISTS` -> Include the `IF EXISTS` clause to instruct the server to issue a notice instead of throwing an error if the foreign table with the specified name doesn't exists. + Include the `IF EXISTS` clause to instruct the server to issue a notice instead of throwing an error if the foreign table with the specified name doesn't exists. `name` -> Specify the name of the foreign table. + Specify the name of the foreign table. `CASCADE` -> Automatically drop objects that depend on the foreign table. It should drop all the other dependent objects too. + Automatically drop objects that depend on the foreign table. It should drop all the other dependent objects too. `RESTRICT` -> Do not allow to drop foreign table if any objects are dependent on it. + Do not allow to drop foreign table if any objects are dependent on it. **Example** @@ -434,4 +434,4 @@ DROP FOREIGN TABLE warehouse; For more information about using the `DROP FOREIGN TABLE` command, see: -> + diff --git a/product_docs/docs/mongo_data_adapter/5.2.9/11_uninstalling_the_mongo_data_adapter.mdx b/product_docs/docs/mongo_data_adapter/5.2.9/11_uninstalling_the_mongo_data_adapter.mdx index 8313284a962..d0d4f05040a 100644 --- a/product_docs/docs/mongo_data_adapter/5.2.9/11_uninstalling_the_mongo_data_adapter.mdx +++ b/product_docs/docs/mongo_data_adapter/5.2.9/11_uninstalling_the_mongo_data_adapter.mdx @@ -4,7 +4,7 @@ title: "Uninstalling the MongoDB Foreign Data Wrapper" -**Uninstalling an RPM Package** +## Uninstalling an RPM Package You can use the `yum remove` or `dnf remove` command to remove a package installed by `yum` or `dnf`. To remove a package, open a terminal window, assume superuser privileges, and enter the command: @@ -18,7 +18,7 @@ You can use the `yum remove` or `dnf remove` command to remove a package install Where `xx` is the server version number. -**Uninstalling MongoDB Foreign Data Wrapper on a Debian or Ubuntu Host** +## Uninstalling MongoDB Foreign Data Wrapper on a Debian or Ubuntu Host - To uninstall MongoDB Foreign Data Wrapper on a Debian or Ubuntu host, invoke the following command.