Use stereotype <<MongoDBAdapter>> on an action node to interact with a MongoDB and to insert, get and manipulate documents.
Inserting Documents
![](/download/attachments/207552655/mongodb_insert.png?version=1&modificationDate=1622707468000&api=v2)
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
![](/download/attachments/207552655/mongodb_delete.png?version=1&modificationDate=1622707535000&api=v2)
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.
![](/download/attachments/204636492/mongodb_customers.png?version=1&modificationDate=1622035550000&api=v2)
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.