Work with Physical Schemas

A physical schema defines a set of MongoDB collections. The physical model is the source of the data which is presented through the logical model. MongoDB allows each document in a collection to have a different schema. Analyzer for MongoDB requires all the documents in your collection to be uniform. The details for working with physical schemas are covered here.

The <CalculatedColumnDef name="the_year" type="Integer"> declares that the sales table has a column called the_year and that you want to use it as an integer. This affects how the column is sorted, and affects the MDX type of expressions built from this column. The <ExpressionView> defines $the_year as the MongoDB attribute to use for the column. There is no requirement that the MongoDB attribute name match the CalculatedColumnDef name, but in most cases that is a reasonable convention to follow.

Nested Attributes

Dot notation can be used to reference attributes that are nested within a MongoDB collection. For example, consider the following document, which groups related attributes under common parents:

Apply MongoDB Aggregation Framework Operators

Valid string, arithmetic and conditional operators are permitted within <CalculatedColumnDef> elements. For example, to construct the full_name column as the concatenation of $fname and $lname, use a definition like the following: