Open
Description
Implement a high-level API for ES|QL AST mutations.
- Ability to add/remove
METADATA
fields - Ability to add/remove
WHERE
commands - Ability to change
LIMIT
- Ability to add/remove
SORT
command expressions - Ability to add/remove
FROM
sources
The API
The API could look something like below.
Manipulate METADATA
fields:
// Remove METADATA field
Query.removeFromMetadata('_id');
// Add METADATA field
Query.addFromMetadata('_id');
Remove commands:
Query.removeCommands(node => node.name === 'limit');
// or
Query.removeCommandsByName('limit')
Change LIMIT
of the query:
// Change LIMIT to specific value
Query.limit.set(10);
// Remove LIMIT command
Query.limit.remove();
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment