Use stereotype <<MongoDBAdapter>> on an action node to interact with a MongoDB and to insert, get and manipulate documents.
Using action find you can retrieve data. MongoDB stores data in form of documents that are depicted in a JSON-like format. Queries always return one or more complete documents.
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. Then, provide this object as queryString by converting it to JSON using classToJson(). |
A find action of a <<MongoDBAdapter>> returns either a result set or a handle.
Name | Type | Description | |
---|---|---|---|
result | Array of String | An array of all resulting documents in JSON format. | The complete set of found documents in an array. |
Array of <document class> | An array of objects of an xUML class representing the document structure.
| ||
handle | MongoDBHandle | A handle to a result set. This is helpful if
| You need to process the result set one by one using fetch. |
Refer to Action "find" and Action "fetch" for a detailed description of all parameters and options.