Table of Contents

Method String

Namespace
MongoDB.Driver.Search
Assembly
MongoDB.Driver.dll

String(string, SearchPathDefinition<TDocument>, int?)

Creates a facet that narrows down Atlas Search results based on the most frequent string values in the specified string field.

public SearchFacet<TDocument> String(string name, SearchPathDefinition<TDocument> path, int? numBuckets = null)

Parameters

name string

The name of the facet.

path SearchPathDefinition<TDocument>

The field path to facet on.

numBuckets int?

The maximum number of facet categories to return in the results.

Returns

SearchFacet<TDocument>

A string search facet.

String<TField>(string, Expression<Func<TDocument, TField>>, int?)

Creates a facet that narrows down Atlas Search result based on the most frequent string values in the specified string field.

public SearchFacet<TDocument> String<TField>(string name, Expression<Func<TDocument, TField>> path, int? numBuckets = null)

Parameters

name string

The name of the facet.

path Expression<Func<TDocument, TField>>

The field path to facet on.

numBuckets int?

The maximum number of facet categories to return in the results.

Returns

SearchFacet<TDocument>

A string search facet.

Type Parameters

TField

The type of the field.