Skip to content
This repository was archived by the owner on Jun 23, 2025. It is now read-only.

How to search for text within attribute list? #184

@bjr001

Description

@bjr001

What's the proper way to filter for value within a (custom) attribute list?

Currently I'm trying to do as following...

var queryCommand = new QueryCommand<ProductProjection>();
queryCommand .Where(p => p.Variants.Any(variant => variant.Attributes.Any(attribute =>
                    attribute.Name == "MyCustomAttribute" &&
                    attribute.ToSetTextAttribute().Value.ContainsAny("MyCustomValue"))));

...which doesn't work out since API returns BadRequest:

Response: {"statusCode":400,"message":"Malformed parameter: where: The field 'value' does not support this expression.","errors":[{"code":"InvalidInput","message":"Malformed parameter: where: The field 'value' does not support this expression."}]}

Any ideas?

Using version 1.1.3 of commercetools.Sdk.All.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions