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 FieldSearchPathReturns aSearchPathfor the givenpath.default BsonValueConverts this object toBsonValue.static WildcardSearchPathwildcardPath(String wildcardPath) Returns aSearchPathfor the givenwildcardPath.Methods inherited from interface org.bson.conversions.Bson
toBsonDocument, toBsonDocument
-
Method Details
-
fieldPath
Returns aSearchPathfor the givenpath.- Parameters:
path- The name of the field. Must not contain wildcard characters.- Returns:
- The requested
SearchPath. - MongoDB documentation
- Dot notation
-
wildcardPath
Returns aSearchPathfor 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 returnsBsonStringrepresenting the value of this key, otherwise returnsBson.toBsonDocument().This method may be useful when using the
ofmethods, 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
BsonValuerepresenting thisSearchPath. - See Also:
-