We need a command that works like jq, but runs queries like ldb eval --query <query> to run queries on plain json files without indexing them first. The examples should be possible:
Alternatively the eval command could be adjusted to handle this.
This should include:
Handling of filtering and selecting separately (i.e. like "where" vs "select" statements). For example it might use --query for filtering and another option like --select for the jmespath expression whose result will be shown. Note the eval command just uses --query for both and evaluates only the last --query (or --file) option given. This logic arose since eval was intended for debugging, but this is too confusing and should be changed later too.
The ability to handle separate json objects separately or as members of a top-level array (i.e. something like jq's --slurp option).
We need a command that works like
jq
, but runs queries likeldb eval --query <query>
to run queries on plain json files without indexing them first. The examples should be possible:Alternatively the
eval
command could be adjusted to handle this.This should include:
--query
for filtering and another option like--select
for the jmespath expression whose result will be shown. Note theeval
command just uses--query
for both and evaluates only the last--query
(or--file
) option given. This logic arose sinceeval
was intended for debugging, but this is too confusing and should be changed later too.jq
's--slurp
option).