PhoenixmlDb.Core

DocumentOptions

Options controlling how a document is stored when calling .

#DocumentOptions

Namespace: PhoenixmlDb.Core

Options controlling how a document is stored when calling

.

All properties have sensible defaults: content type is auto-detected, overwrite is enabled, and no initial metadata is set. You only need to create a DocumentOptions instance when you want to override one of these defaults.

Common scenarios requiring explicit options:

#Example

csharp
var options = new DocumentOptions
{
    ContentType = ContentType.Xml,
    Overwrite = false,
    Metadata = new Dictionary<string, object>
    {
        ["author"] = "Jane Smith",
        ["department"] = "Engineering"
    }
};
await container.PutDocumentAsync("reports/q1-2024.xml", xmlContent, options);
                                  

#Properties

Name Description
ContentType Gets the content type (XML or JSON) for the document. When null (the default), the content type is auto-detected from the document content.
Metadata Gets the initial metadata to attach to the document at creation time. When null (the default), no metadata is set.
Overwrite Gets whether to overwrite an existing document with the same name. Defaults to true.