Skip to content
On this page

How Documents are Stored

TODO -- feel like this is covered in the /document part and was copied there, so delete this page.

Marten will create a new database table and upsert function for each document type. By default, the table name is mt_doc_[alias] and the function is mt_upsert_[alias], where "alias" is the document type name in all lower case letters, or "parent type name + inner type name" for nested types.

In the not unlikely case that you need to disambiguate table storage for two or more documents with the same type name, you can override the type alias either programmatically with MartenRegistry:

var store = DocumentStore.For(_ =>


snippet source | anchor

or by decorating the actual document class with an attribute:

public class Tractor
    public string id;

snippet source | anchor

Released under the MIT License.