Interface MongoDBFieldFunctionAdapterInterface

All Superinterfaces:
BackendFieldFunctionAdapterInterface, Serializable
All Known Implementing Classes:
MongoDBStringLengthFunction, MongoDBSubStringFunction, MongoDBWeekdayOfDateFunction, MongoDBWeekdayOfDateTimeFunction

public interface MongoDBFieldFunctionAdapterInterface extends BackendFieldFunctionAdapterInterface
MongoDB-specific extension of BackendFieldFunctionAdapterInterface for adapting a FieldFunction into MongoDB aggregation expressions. Implementations return BSON-compatible objects (typically Document instances) representing MongoDB aggregation expressions (e.g., {$strLenCP: "$fieldName"}).
  • Method Details

    • getExpression

      Object getExpression(String fieldReference, FieldFunction fieldFunction, Function<String,String> fieldNameToFieldReference)
      Returns a MongoDB aggregation expression for the given field reference. The fieldReference is a "$"-prefixed field name (e.g., "$firstName").
      Parameters:
      fieldReference - "$"-prefixed field name for the function's source field.
      fieldFunction - the function with arguments.
      fieldNameToFieldReference - resolves a QQQ field name to its "$"-prefixed MongoDB field reference (e.g., "timeZone" → "$time_zone"). Useful when the function expression needs to reference additional fields on the same document (e.g., a per-row timezone field).
    • getExpressionForOrderBy

      default Object getExpressionForOrderBy(String fieldReference, FieldFunction fieldFunction, Function<String,String> fieldNameToFieldReference)
      Returns a MongoDB aggregation expression for use specifically in $sort stages. Defaults to getExpression(); may be overridden when the sort form differs (e.g., a modulo for Sunday-first weekday sorting).