Table of Contents

Method HasRoot

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

HasRoot(SearchDefinition<TDocument>, SearchScoreDefinition<TDocument>)

Creates a search definition that moves the context back up the tree of embedded documents to the root such that root fields can be used in searches of embedded documents.

public SearchDefinition<TDocument> HasRoot(SearchDefinition<TDocument> @operator, SearchScoreDefinition<TDocument> score = null)

Parameters

operator SearchDefinition<TDocument>

The operator to execute at the root.

score SearchScoreDefinition<TDocument>

The score modifier.

Returns

SearchDefinition<TDocument>

A search definition for the root.