API overview
The main collection and diagnostic members.
INetlyDBCollection<T>
The application-facing typed collection, registered by AddNetlyDBCollection<T>().
| Member | Purpose |
|---|---|
Add / AddAsync | Insert one document; optional time-to-live. Returns the id. |
AddRange / AddBatch (+ Async) | Insert many documents; AddRangeAsync also streams from an IAsyncEnumerable. |
Find / FindAsync | Load a document by id. |
All / AllAsync | Every document in the collection. |
Query() | A fluent query with LINQ or filter-string Where, ordering and paging. |
ListAsync / FirstOrDefaultAsync / AnyAsync / CountAsync | Query with a LINQ predicate or a filter string. |
Update / UpdateAsync | Replace a document by id. |
UpdateWhereAsync | Set fields on every document matching a predicate. |
Delete / DeleteAsync / DeleteWhereAsync | Remove by id or by predicate. |
CreateIndex | Declare an index from a property expression. |
CreateFullTextIndex / FullTextSearch | BM25 keyword index and ranked search. |
CreateVectorIndex / CreateExternalVectorIndex | Flat or HNSW vector index, on a property or kept externally. |
SetVector / SetVectors / VectorSearch | Store vectors by document id; k-nearest-neighbour search. |
IDocumentCollection<T>
The lower-level collection, resolved from dependency injection or opened through IDocumentStore. In addition
to the operations above it offers:
| Member | Purpose |
|---|---|
WhereAsync | Query with a filter string, LINQ or a JSON filter; the result carries a query Explanation. |
SelectAsync / QueryAsync | SELECT projections, and text UPDATE / DELETE statements. |
TryUpdate / TryDelete | Optimistic concurrency: succeed only when the document is at the expected revision. |
GetMutationStatusAsync | Resolve what happened to a write whose outcome was indeterminate. |
Stores
IDocumentStore- open document collections by type or name, list collections and their schemas.IFileStore- open and create file collections.INamedNetlyDBCollectionProvider<T>- resolve named collections of one type.
Diagnostic members are listed on Diagnostics.