This documentation is for WSO2 Data Services Server 3.2.2. View documentation for the latest release.
Page Comparison - MongoDB Sample (v.4 vs v.5) - Data Services Server 3.2.2 - WSO2 Documentation

Versions Compared

Key

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

MongoDB is a NoSQL type, open-source document database. This sample demonstrates the usage of a MongoDB as a data source in WSO2 DSS.

Table of Contents
maxLevel3
minLevel3

About the sample

The list of operations used by the his sample data service to carry out the actions are as follows.contains the operations listed below. See Data Services and Resources for a definition of data services and operations.

  • mongo_insert: This operation adds a document according to the provided id, name.
  • mongo_insert_doc: Using this operation you can inserts a document into the 'things' collection:
  • mongo_find: This operation returns all documents from the collection.
  • mongo_count: This operation counts and returns the number of all documents in the 'things' collection
  • mongo_update: This operation sets the name as 'Zack' and the id as the provided value for the document where name is 'Bob'
  • mongo_remove: This operation removes all the documents from the collection 'things' where id is equal to the given value
  • mongo_drop: This operation will drop the collection 'things' from the database

...

Building the sample

The sample data service named MongoDBSample MongoDBSample should be deployed using the instructions in the Samples Setup section.

Running the sample

The sample can be run using any SOAP client such as the Tryit tool that comes bundles bundled with WSO2 DSS.

Follow the steps below to demonstrate this functionality using the TryIt tool:

  1. Log in to the management console of your server and click List under Services in the navigator. The MongoDBSample will be listed here.
  2. Click Try this service to open the TryIt tool.
  3. Select the relevant operation and click Send to execute the commands as shown below.
    • Invoking the operation 'mongo_insert' to insert a document
       
    • Invoking the operation 'mongo_find' to retrieve the data in the collection