Class BindableMongoExpression

java.lang.Object
org.springframework.data.mongodb.BindableMongoExpression
All Implemented Interfaces:
MongoExpression

public class BindableMongoExpression extends Object implements 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 Details

    • BindableMongoExpression

      public BindableMongoExpression(String expression, Object @Nullable [] args)
      Create a new instance of BindableMongoExpression.
      Parameters:
      expression - must not be null.
      args - must not be null but may contain null elements.
    • BindableMongoExpression

      public BindableMongoExpression(String expression, @Nullable CodecRegistryProvider codecRegistryProvider, Object @Nullable [] args)
      Create a new instance of BindableMongoExpression.
      Parameters:
      expression - must not be null.
      codecRegistryProvider - can be null.
      args - must not be null but may contain null elements.
  • Method Details