1 Reply Latest reply: Mar 11, 2016 2:05 AM by Ankur Saraswat RSS

    Query for MongoDb from Datawatch Designer

    Fara Naz

      Anybody here would like to share with me on how to query for Mongodb from designer? thanks.

        • Re: Query for MongoDb from Datawatch Designer
          Ankur Saraswat

          Hi Fara,

           

          Please follow the below steps to query the MongoDB database from Designer.

           

          Steps:

          1. Launch the Connect to Data dialog and then select MongoDB. The MongoDB Connection Settings dialog displays:

          2. Provide the hostname, user ID, and password required to connect to the MongoDB database you wish to access. If the port you wish to use is different from the default port, change the default value to the correct one.

          3. Specify other connection options if desired, making sure to separate individual connection strings by a semi-colon.

          Please see Page 170 of the Designer Reference Guide for the list of Attributes supported by the MongoDB driver, along with their default values.

          4. Enter the Schema Definition Path.

          5. Enter or select the name of the database to which you want to connect.

          6. The easiest way to select a table and/or view to load is by choosing from a set of predefined tables and views. To do so, ensure that the Tables & Views button is selected. If you wish to manually construct a SQL query to pull and load a data, ensure that the Query button is selected. Once either a table or view or a query has been selected, the OK button at the bottom of the dialog is enabled.

          7. Click Load Tables to load a list of predefined tables or views. This list can be filtered by entering an appropriate string in the Search Tables search box.

          8. Select a table to display the available columns in the Column list. Once a table has been selected, the Query text box is updated to reveal the results of a SELECT * FROM TABLE query. Any other selection made updates the Query text box accordingly.

          9. Select the columns to add to your data table by either double-clicking each column individually or pressing CTRL+A to add all of the columns.

          10. If you wish to parameterize a specific column, check the Parameterize checkbox and, in the dropdowns that display, select the desired value.

          11. The selected columns display in the Selected Columns list.

          12. If the data returned is to be aggregated, check the Aggregate checkbox. The following aggregation methods are possible:

          • Text Columns: Group By
          • Date Columns: Count, Min, Max, Group By
          • Numeric Columns: Sum, Count, Min, Max, Group By.

          The time zone of input parameters and output data is, by default, unchanged. Changing the time zone is supported by using the Timezone list box based on the assumption that data are stored in UTC time and outputs are presented in the selected time zone.

          13. Check the box for Enable on-demand queries if you would like to enable this function.

          14. Click OK to confirm the selection and retrieve the record set into Designer.

          The flat record set corresponding to the executed SQL is returned from the source database and displayed in Data Prep with the database name as the title and all fields listed displayed in Data Preview.

          15. If you wish to make changes to your fields, you may do so now and then click OK when you are finished. If you do not wish to make any changes to your data, simply select the OK button.

           

          Thanks,

          Ankur