Skip to main content
Windward

MongoDB Wizard

Overview

The MongoDB wizard makes selecting data easy, with an intuitive click-and-drag interface similar to the SQL and OData wizards.

The MongoDB Wizard Interface

 

MongoWizard.PNGThe MongoDB wizard is composed of four main sections: the data pane on the left, the select options in the middle, the query results on the right, and the built query statement on the bottom. To access the MongoDB Wizard, insert a ForEach Tag under the "AutoTag" ribbon, select it, and click on the "Wizard" ribbon icon.

The Data Pane

The data pane shows the MongoDB schema for the data source in use. Because MongoDB is a schema-less database system, this pane may not show all fields which are contained in a collection. Rather, for the sake of speed, our software simply scans the first element of each collection, and assumes that the whole collection has the same format. However, all fields in a document should still be accessible from our engine, they will simply need to be typed by hand into the select statement.

The Select Options Pane

To begin forming a query, select a collection from the data pane and drag it to the "Collection" section in the middle pane. In the image above, the "Employees" collection is used.

Next you may set filter options, to select a subset of the documents in the collection. It is important in this section that the user formats the "value" section correctly, as the schema-less nature of MongoDB makes it difficult to predict if the user meant to enter a string, or a number, or some other type. In the image above, the strings 'Davolio' and 'Nancy', were typed with leading and trailing quotation marks ("), to indicate that they are strings.

The next section is the "Select" section, which lets the user limit the returned fields of each document. If an array field is placed in this section, then clicking the link in that section will open an extended menu which allows the user to specify an index into that array to use:

ArrayMenu.png

Next, we have the "Order By" section, which lets the user sort the returned documents based on a specific field in those documents.

Finally, the "Limit" section simply lets the user grab only the first X number of documents, where the default value of 0 means return all documents in the collection.

The Results Pane

The results pane will periodically update with a sample view of the data found from the query as it has been built. Although, MongoDB, and our engine provide support for embedded documents, the results pane does not, and will simply display an error message in the fields where an embedded document would be found.

The Query Statement Pane

The query statement will be displayed at the bottom of the pane as it is being built. Although our engine does support most MongoDB query functions such as ".sort()" and ".count()", these are not displayed by the wizard as the "operator method" is more powerful and easier to parse. 

If you wish to hard code your own select, and see the results as you go, you may use the "Advanced" button, which will disable the select options pane, but will allow the query statement pane to be edited.

  • Was this article helpful?