Skip to content

Simple unbound field name matches don't work #2

@msackman

Description

@msackman

In your examples, you have the rather impressive:

match({ '$v': '$y', '$x': [1,2,'$v'], i: '$x'}, { i: 'd', b: [23, 44], a: 3, c: 3, d: [1,2,'b']})

which works. However, much simpler matches do not work:

isMatch({'$a': '$b'}, {c: 5}); // false
isMatch({'$a': 5}, {c: 5}); // false

whereas

isMatch({c: '$b'}, {c: 5}); // true

But there is a problem - if you make the first two work then you then have some ambiguity issues:

match({'$a': 5}, {x: 5, y: 5, z: 5})

What on earth should '$a' be bound to in the resultant object? Or should you support a /g-like regex flag and be able to reissue the query and get the next result?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions