Creating Synonyms With MongoDB

How to:

Synonyms define unique names (or aliases) for each MongoDB collection that is accessible from a server. Synonyms are useful because they hide the location and identity of the underlying data source from client applications. They also provide support for extended metadata features of the server, such as virtual fields and additional security mechanisms.

Using synonyms allows an object to be moved or renamed while enabling client applications to continue functioning without modification. The only modification required is a redefinition of the synonym on the server. The result of creating a synonym is a Master File and Access File based on a given MongoDB collection.

Procedure: How to Create a Synonym

To create a synonym, you must have previously configured the adapter and a connection.

  1. From the Web Console sidebar, click Applications or Connect to Data.

    The Applications page opens.

  2. If you started from the Applications page, right-click an application folder, point to New, and click Synonym on the context menu.

    The Connect to Data page opens.

  3. Under the MongoDB folder, select a connection and right click. Click Show DBMS objects for MongoDB (CON01).

    The Synonym Candidate dialog box opens.

  4. From the object type drop-down list, select Tables.
  5. Click Next.

    The list of tables opens.

  6. Select the check box for the objects for which you want to create synonyms. If you want to change the name of the synonym from the default name, click the name and edit it as needed.
  7. Optionally, expand the Customize data type mappings section and enter a value for Longchar Length or numeric precision.
  8. Click the purple arrow to create the synonym.

The Status pane indicates that the synonym was created successfully. The synonym is created and added under the specified application directory.

WebFOCUS

Feedback