Fuse icon indicating copy to clipboard operation
Fuse copied to clipboard

Provide `key` in matching object when using query logical operators

Open bernatesquirol opened this issue 3 years ago • 0 comments

Description

If the query provided is using query logical operators, it would be nice that the attribute key is also included in the matching object (like it is when we don't use logical operators), in order to identify which of the conditions are found for a given match. { $or: [{ "brand.name": query }, { "name": query }] }

Describe the solution you'd like

The desired solution is having the key in each match object. { $or: [{ "brand.name": query }, { "name": query }] } I get that the same key could be repeated in the logical operations { $or: [{ "name": '=query' }, { "name": '^query' }] } but it would be fine not knowing which of those "two" are matched

Describe alternatives you've considered

The alternative is creating several intances of the fuse search with each one key, in order to stablish which match comes from where.

bernatesquirol avatar Jun 29 '22 10:06 bernatesquirol