Package org.springframework.data.mongodb
Class BindableMongoExpression
java.lang.Object
org.springframework.data.mongodb.BindableMongoExpression
- All Implemented Interfaces:
- MongoExpression
A 
 
MongoExpression using the ParameterBindingDocumentCodec for parsing a raw (json)
 expression. The expression will be wrapped within { ... } if necessary. The actual parsing and parameter
 binding of placeholders like ?0 is delayed upon first call on the target Document via
 toDocument().
 
 $toUpper : $name                -> { '$toUpper' : '$name' }
 { '$toUpper' : '$name' }        -> { '$toUpper' : '$name' }
 { '$toUpper' : '?0' }, "$name"  -> { '$toUpper' : '$name' }
 
 Some types might require a special Codec. If so, make sure to provide a CodecRegistry
 containing the required codec via withCodecRegistry(CodecRegistry).- Since:
- 3.2
- Author:
- Christoph Strobl, Giacomo Baso
- 
Constructor SummaryConstructorsConstructorDescriptionBindableMongoExpression(String expression, Object[] args) Create a new instance ofBindableMongoExpression.BindableMongoExpression(String expression, CodecRegistryProvider codecRegistryProvider, Object[] args) Create a new instance ofBindableMongoExpression.
- 
Method SummaryModifier and TypeMethodDescriptionProvide the arguments to bind to the placeholders via their index.org.bson.DocumentObtain the nativeDocumentrepresentation.toString()withCodecRegistry(org.bson.codecs.configuration.CodecRegistry codecRegistry) Provide theCodecRegistryused to convert expressions.
- 
Constructor Details- 
BindableMongoExpressionCreate a new instance ofBindableMongoExpression.- Parameters:
- expression- must not be null.
- args- can be null.
 
- 
BindableMongoExpressionpublic BindableMongoExpression(String expression, @Nullable CodecRegistryProvider codecRegistryProvider, @Nullable Object[] args) Create a new instance ofBindableMongoExpression.- Parameters:
- expression- must not be null.
- codecRegistryProvider- can be null.
- args- can be null.
 
 
- 
- 
Method Details- 
withCodecRegistrypublic BindableMongoExpression withCodecRegistry(org.bson.codecs.configuration.CodecRegistry codecRegistry) Provide theCodecRegistryused to convert expressions.- Parameters:
- codecRegistry- must not be null.
- Returns:
- new instance of BindableMongoExpression.
 
- 
bindProvide the arguments to bind to the placeholders via their index.- Parameters:
- args- must not be null.
- Returns:
- new instance of BindableMongoExpression.
 
- 
toDocumentpublic org.bson.Document toDocument()Description copied from interface:MongoExpressionObtain the nativeDocumentrepresentation.- Specified by:
- toDocumentin interface- MongoExpression
- Returns:
- never null.
 
- 
toString
 
-