Class MongoDBWeekdayOfDateTimeFunction
java.lang.Object
com.kingsrook.qqq.backend.module.mongodb.fieldfunctions.MongoDBWeekdayOfDateTimeFunction
- All Implemented Interfaces:
BackendFieldFunctionAdapterInterface,MongoDBFieldFunctionAdapterInterface,Serializable
public class MongoDBWeekdayOfDateTimeFunction
extends Object
implements MongoDBFieldFunctionAdapterInterface
MongoDB adapter for WeekdayOfDateTimeFunction.
Same ISO conversion as WeekdayOfDate, but uses timezone-aware
form of $dayOfWeek: {$dayOfWeek: {date: "$field", timezone: "tz"}}.
Timezone resolution follows the same priority as the RDBMS version
and the core WeekdayOfDateTimeFunction:
1. Per-row field value (zoneIdFromFieldName), falling back to static tz via $ifNull
2. Explicit timeZoneId argument
3. Session zone ID (if useSessionZoneId is true)
4. Instance default time zone
- 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.getExpressionForOrderBy(String fieldReference, FieldFunction fieldFunction, Function<String, String> fieldNameToFieldReference) Returns a MongoDB aggregation expression for use specifically in $sort stages.
-
Constructor Details
-
MongoDBWeekdayOfDateTimeFunction
public MongoDBWeekdayOfDateTimeFunction()
-
-
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).
-
getExpressionForOrderBy
public Object getExpressionForOrderBy(String fieldReference, FieldFunction fieldFunction, Function<String, String> fieldNameToFieldReference) Description copied from interface:MongoDBFieldFunctionAdapterInterfaceReturns 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).- Specified by:
getExpressionForOrderByin interfaceMongoDBFieldFunctionAdapterInterface
-