Skip to content

Cannot filter queries by keys in object arraysย #40

@tonyketcham

Description

@tonyketcham

The sift implementation currently uses positional assumptions on what you intend to filter.

To decode what that means, a filter argument is of the form filter: { title: { wildcard: "*tion" }}.

This assumes that the last keyname of the deepest nested object is the comparitor function, in this case it means, "use the regex wildcard function", and filters by the title field for all tuples matching the value *tion.

This assumption breaks down when you need to compare a field of an object on an array.

If we have an authors field on a Posts collection, we could imagine that data would be an array of author objects.

  • the syntax of filter: { authors: { name: { wildcard: "*tion" }}} isn't valid
  • nor is filter: { authors: { wildcard: { name: "*tion" }}}

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcorecentral engine

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions