Inserting and Deleting Documents
This page explains the MongoDB Adapter in Bridge context. If you were looking for the same information regarding the PAS Designer, refer to MongoDB Adapter in the Designer guide.
Use stereotype <<MongoDBAdapter>> on an action node to interact with a MongoDB and to insert, get and manipulate documents.
Example File (Builder project Add-ons/MongoDB):
<your example path>\Add-ons\MongoDB\uml\simpleMongoDbAccess.xml |
Inserting Documents
Using action insert you can insert one or more documents into a MongoDB. Refer to Action "insert" for a detailed description of all parameters and options.
Deleting Documents
Using action delete you can remove one or more documents from a MongoDB.
For all actions that refer to existing documents, you need to provide a query string (queryString) to identify them. A query string contains all properties of the document you want to use for selection.
The simplest way to create a query string is to create an object having the structure of the document (queryData in the example above), and set all query values to this object.
Then, provide this object as queryString by converting it to JSON using classToExtendedJSON().
You can remove all documents by providing {
}
as queryString.
Refer to Action "delete" for a detailed description of all other parameters and options.