Skip to content
Client v5: BLE, BLE Hosting, HTTP, Jobs - Linux, MacOS, & Blazor Support! Full AOT, RX on BLE only & MANY other features! Power up!

Amazon DocumentDB

The Shiny.DocumentDb.DocumentDb package provides a document store over Amazon DocumentDB. Because DocumentDB is MongoDB-wire-compatible, this provider is a thin subclass of the MongoDB provider — you get the full MongoDB feature set, minus the capabilities DocumentDB doesn’t implement, plus DocumentDB-appropriate connection defaults.

NuGet package Shiny.DocumentDb.DocumentDb
  • Existing Amazon DocumentDB clusters
  • You want the MongoDB provider’s behavior against a managed AWS backend
Terminal window
dotnet add package Shiny.DocumentDb.DocumentDb
  1. Direct instantiation

    using Shiny.DocumentDb.DocumentDb;
    var store = new DocumentDbDocumentStore(new DocumentDbDocumentStoreOptions
    {
    ConnectionString = "mongodb://user:pass@cluster-endpoint:27017/?replicaSet=rs0&readPreference=secondaryPreferred",
    DatabaseName = "app",
    CaCertificatePath = "global-bundle.pem" // Amazon RDS CA bundle
    });
  2. Dependency injection

    using Shiny.DocumentDb;
    builder.Services.AddDocumentDbDocumentStore(o =>
    {
    o.ConnectionString = "mongodb://user:pass@cluster-endpoint:27017/?replicaSet=rs0";
    o.DatabaseName = "app";
    o.CaCertificatePath = "global-bundle.pem";
    });

    AddDocumentDbDocumentStore registers IDocumentStore and IDocumentMaintenance as singletons.

DocumentDB differs from MongoDB in two connection-level defaults, both handled for you:

  • TLS is on by default. Provide the Amazon RDS CA bundle via CaCertificatePath (or a preloaded CaCertificates collection). Set UseTls = false only for a local MongoDB proxy in tests.
  • retryWrites = false by default. DocumentDB does not support retryable writes; the MongoDB driver’s default (true) would break writes.

Everything from the MongoDB provider is inherited — CRUD, LINQ push-down, ordering/paging/projection, spatial (2dsphere), temporal history, backup, maintenance, optimistic-concurrency CAS, and the compensating unit of work — except:

FeatureMongoDBAmazon DocumentDB
Full-text ($text) FullTextSearch<T>yesthrows — DocumentDB has no $text (use Amazon OpenSearch)
Vector search NearestVectors<T>yes (Atlas)throws — Atlas $vectorSearch syntax is unsupported
SupportsFullText / SupportsVectortruefalse

Identical to the MongoDB provider: Guid/string Ids auto-generate; Int/Long Id auto-generation is unsupported; MapVersionProperty<T> provides optimistic concurrency (ConcurrencyException on conflict) folded into an atomic filtered update.

  • No $text full-text and no vector search (see the table above).
  • Some MongoDB aggregation/$expr operators vary by DocumentDB engine version — a heavily computed Where may need to be simplified.
  • Everything else follows the MongoDB provider — see its page for query, storage, and unit-of-work details.