Table of Contents

Class Builders<T>

Namespace
DataStax.AstraDB.DataApi.Core
Assembly
DataStax.AstraDB.DataApi.dll

A collection of builders for creating filter, projection, sort, and update definitions

public class Builders<T>

Type Parameters

T

The type of the documents

Inheritance
Builders<T>
Inherited Members

Properties

CollectionFilter

A builder for creating filter definitions for collections

public static CollectionFilterBuilder<T> CollectionFilter { get; }

Property Value

CollectionFilterBuilder<T>

Examples

var filter = Builders<DocumentType>.CollectionFilter;
filter = filter.Where(x => x.Name == "NameSearch");

CollectionFindAndRerankSort

A builder for creating sort definitions for the FindAndRerank collection operation

public static CollectionFindAndRerankSortBuilder<T> CollectionFindAndRerankSort { get; }

Property Value

CollectionFindAndRerankSortBuilder<T>

Examples

var sort = Builders<DocumentType>.CollectionFindAndRerankSort;
sort = sort.Hybrid("A tree in the woods");

CollectionSort

A builder for creating sort definitions for collections

public static CollectionSortBuilder<T> CollectionSort { get; }

Property Value

CollectionSortBuilder<T>

Examples

var sort = Builders<DocumentType>.CollectionSort;
sort = sort.Ascending(x => x.Name);

CollectionUpdate

A builder for creating update definitions for collections

public static UpdateBuilder<T> CollectionUpdate { get; }

Property Value

UpdateBuilder<T>

Examples

var update = Builders<DocumentType>.CollectionUpdate;
update = update.Set(x => x.Name, "NewName");

Projection

A builder for creating projection definitions

public static ProjectionBuilder<T> Projection { get; }

Property Value

ProjectionBuilder<T>

Examples

var projection = Builders<DocumentType>.Projection;
projection = projection.Include(x => x.Name);

TableFilter

A builder for creating sort definitions for tables

public static TableFilterBuilder<T> TableFilter { get; }

Property Value

TableFilterBuilder<T>

Examples

var sort = Builders<RowType>.TableSort;
sort = sort.Ascending(x => x.Name);

TableIndex

A builder for creating table indexes

var index = Builders.TableIndex.Text();
table.CreateIndex("index_name", r => r.SomeTextProperty, index);
public static TableIndexBuilder TableIndex { get; }

Property Value

TableIndexBuilder

TableSort

A builder for creating sort definitions for tables

public static TableSortBuilder<T> TableSort { get; }

Property Value

TableSortBuilder<T>

Examples

var sort = Builders<RowType>.TableSort;
sort = sort.Ascending(x => x.Name);

TableUpdate

A builder for creating update definitions for tables

public static UpdateBuilder<T> TableUpdate { get; }

Property Value

UpdateBuilder<T>

Examples

var update = Builders<RowType>.TableUpdate;
update = update.Set(x => x.Name, "NewName");