8000 Keypath substitution in queries · Issue #7033 · realm/realm-core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content 8000
Keypath substitution in queries #7033
Closed
@astigsen

Description

@astigsen

Currently all keypaths used in queries has to be specified in full and has to match the schema to not give an error. This is a problem for enabling search on dynamic properties, and in general makes it hard to adapt queries to less predictable scenarios.

NSPredicates solves this by allowing you to substitute keypaths using the %K identifier:

"%K == %@"
pass a string variable to %K, it will be represented as a keypath, then check if it’s value is equal to value passed in

We should allow the same in RQL. Since our substitution syntax is slightly different (using $<pos> instead of %@) we might want to use a simple annotation to signify that this substitution should be interpreted as a keypath (like $<pos>k).

Part of #2978

Metadata

Metadata

Assignees

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

    0