Skip to content

$sm fields inside $match — allowed by example, forbidden by Note 1 ? #570

Description

@DenisBiondic

Section "Match of Elements in Lists" states in Note 1:

"If the comparisons inside an $match clause contains expressions that are not pointing to the list under consideration, an error shall be returned."

However, the TechnicalData example in "Examples for Grammar and JSON Schema" includes $sm#idShort inside $match:

$and(
$match(
$sm#idShort $eq "TechnicalData",
$sme.ProductClassifications[].ProductClassId#value $eq "27-37-09-05"
),
...
)

$sm#idShort is a scalar submodel-level field — it does not point to any list. Per Note 1 this should be an error, but the example treats it as valid.

Question: Are scalar fields (like $sm#idShort) that don't reference any list intentionally allowed inside $match as contextual filters? Or should the example use $and instead of $match for the $sm#idShort condition?

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationquestionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions