Skip to content

Use expressions while calculating values #104

@kbarbounakis

Description

@kbarbounakis

Is your feature request related to a problem? Please describe.
@themost/query provides methods of calculating literal values by defining expressions like

"$expr": {
    "$round": [
        14567.5671,
        2
    ]
}

DefaultValueListener and CalculatedValueListener use FunctionContext to calculate values by using native javascript closures but this operation should be improved and try to use @themost/query approach of calculating literal values.

Describe the solution you'd like
Use @themost/query for defining default or calculated values e.g.

{
            "@id": "https://themost.io/schemas/dateModified",
            "name": "dateModified",
            "title": "dateModified",
            "description": "The date on which this item was most recently modified.",
            "type": "DateTime",
            "readonly": true,
            "calculation": {
                  "$expr": {
                        "$now": []
                   }
            }
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions