Package com.mongodb.client.model.search
Interface SearchPath
- All Superinterfaces:
Bson
- All Known Subinterfaces:
FieldSearchPath
,WildcardSearchPath
A specification of fields to be searched.
Depending on the context, one of the following methods may be used to get a representation of a SearchPath
with the correct syntax: Bson.toBsonDocument()
, toBsonValue()
, FieldSearchPath.toValue()
.
- Since:
- 4.7
- MongoDB Atlas documentation
- Path
-
Field Summary
Fields inherited from interface org.bson.conversions.Bson
DEFAULT_CODEC_REGISTRY
-
Method Summary
Modifier and TypeMethodDescriptionstatic FieldSearchPath
Returns aSearchPath
for the givenpath
.default BsonValue
Converts this object toBsonValue
.static WildcardSearchPath
wildcardPath
(String wildcardPath) Returns aSearchPath
for the givenwildcardPath
.Methods inherited from interface org.bson.conversions.Bson
toBsonDocument, toBsonDocument
-
Method Details
-
fieldPath
Returns aSearchPath
for the givenpath
.- Parameters:
path
- The name of the field. Must not contain wildcard characters.- Returns:
- The requested
SearchPath
. - MongoDB documentation
- Dot notation
-
wildcardPath
Returns aSearchPath
for the givenwildcardPath
.- Parameters:
wildcardPath
- The specification of the fields that contains wildcard ('*'
) characters. Must not contain'**'
.- Returns:
- The requested
SearchPath
. - MongoDB documentation
- Dot notation
-
toBsonValue
Converts this object toBsonValue
. IfBson.toBsonDocument()
contains only the "value" key, then returnsBsonString
representing the value of this key, otherwise returnsBson.toBsonDocument()
.This method may be useful when using the
of
methods, e.g.,SearchHighlight.of(Bson)
. Depending on the syntax of the document being constructed, it may be required to use the methodFieldSearchPath.toValue()
instead.- Returns:
- A
BsonValue
representing thisSearchPath
. - See Also:
-