Class MongoDBStringLengthFunction
java.lang.Object
com.kingsrook.qqq.backend.module.mongodb.fieldfunctions.MongoDBStringLengthFunction
- All Implemented Interfaces:
BackendFieldFunctionAdapterInterface,MongoDBFieldFunctionAdapterInterface,Serializable
public class MongoDBStringLengthFunction
extends Object
implements MongoDBFieldFunctionAdapterInterface
MongoDB adapter for StringLengthFunction.
Generates {$strLenCP: "$field"} — Unicode code point count,
equivalent to SQL CHAR_LENGTH.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetExpression(String fieldReference, FieldFunction fieldFunction, Function<String, String> fieldNameToFieldReference) Returns a MongoDB aggregation expression for the given field reference.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.kingsrook.qqq.backend.module.mongodb.fieldfunctions.MongoDBFieldFunctionAdapterInterface
getExpressionForOrderBy
-
Constructor Details
-
MongoDBStringLengthFunction
public MongoDBStringLengthFunction()
-
-
Method Details
-
getExpression
public Object getExpression(String fieldReference, FieldFunction fieldFunction, Function<String, String> fieldNameToFieldReference) Description copied from interface:MongoDBFieldFunctionAdapterInterfaceReturns a MongoDB aggregation expression for the given field reference. The fieldReference is a "$"-prefixed field name (e.g., "$firstName").- Specified by:
getExpressionin interfaceMongoDBFieldFunctionAdapterInterface- 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).
-