Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

  • Datasource ID: Enter mongo as the ID for the datasource. 
  • Datasource Type: Select MongoDB as the datasource type from the list. 
  • You can then specify the connection details to the MongoDB database you set up previously. Image Removed
    Image Added
    The fields available for the MongoDB datasource type are as follows:
    • Servers: A comma separated list of server hosts and ports where the database is running. E.g.: "localhost" - "125.10.5.3, 125.10.5.4" - "192.168.3.1:27017, 192.168.3.2:27017".
    • Database Name:  The name of the database to which you want to connect.
    • Write Concern:  Select NONE from the list. The write concern value to control the write behavior as well as exception raising on error conditions: 

      Expand
      titleDescriptions of Write Concern options
      OptionDescription
      FSYNC_SAFEExceptions are raised for network issues, and server errors. The write operation waits for the server to flush the data to disk.
      NONENo exceptions are raised, even for network issues.
      NORMALExceptions are raised for network issues, but not server errors.
      REPLICAS_SAFEExceptions are raised for network issues, and server errors; waits for at least 2 servers for the write operation.
      SAFEExceptions are raised for network issues, and server errors; waits on a server for the write operation.
    • Read Preference: Select PRIMARY from the list. The read preference value, which describes how MongoDB clients route read operations to members of a replica set. It has the following options.

      Expand
      titleDescriptions of Read Preference options
      OptionDescription
      PRIMARYDefault mode. All operations read from the current replica set primary.
      SECONDARYAll operations read from the secondary members of the replica set.
    • Auto Connect Retry: Controls whether or not to connect. That is, the system retries to connect automatically.
    • Connection Timeout: Connection timeout in milliseconds. 0 is default and infinite.
    • Max. Wait: Max wait time of a blocking thread for a connection.
    • Socket Timeout: Socket timeout value. 0 is default and infinite.
    • Connections per Host: If the number of connections allowed per host is exceeded, further connections will be blocked.
    • Threads Allowed to Block For Connection Multiplier: The value in this field, multiplied by the connections per host, gives the maximum number of threads that may be waiting for a connection to become available from the pool. All further threads will get an exception. For example, if connections per host is 10 host are 10 and the 'threads allowed to block for connection multiplier' is 5, up to 50 threads can wait for a connection.

...

Follow the steps given below.

  1.  Click Add New Operation to open the relevant screen.
  2. In the Operation Name field, enter mongo_insert_op.
  3. In the Query ID field, select the mongo_insert query, which you created in the previous step.
  4. Save the operation.
  5. In the same way, create the mongo_find_op operation to invoke the mongo_find query.
  6. You will now have two operations listed.

...

  1. Go to the Deployed Services screen.
  2. Click the Try this service link for the MongoDB data service. The TryIt Tool will open with the MongoDB service.
  3. Select the mongo_insert_op operation and enter values for ID and Name.
  4. Click Send to execute the operation. The data will be inserted to the database.
  5. Now, select the mongo_find_op operation and click Send. The response will be published in the TryIt tool