diff --git a/.gitignore b/.gitignore index ce6fba2..ad091e3 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ /docs/.cache /docs/venv /docs/site +/docs/docs + diff --git a/docs/assets/images/social/docs/index.png b/docs/assets/images/social/docs/index.png new file mode 100644 index 0000000..1c465f2 Binary files /dev/null and b/docs/assets/images/social/docs/index.png differ diff --git a/docs/index.html b/docs/index.html index 3caca02..22276f8 100644 --- a/docs/index.html +++ b/docs/index.html @@ -406,8 +406,7 @@
rjq
is a simple and lightweight CLI JSON filtering tool designed for Windows and Linux.
--load
- Loads JSON data from file.--load
- Loads JSON data from file.--query
- Query to be performed on the dataset.--params
- Selects specific fields that will be returned as result.rjq --load=\"<file name>\"
- Loads JSON data from file and returns all the data as result.rjq --query=\"<query string>\"
- Sets query string.rjq --params=\"<comma separated field names>\"
- Sets fileds for the resultrjq --load=\"test.json\" --query=\"<query string>\" --params=\"<comma separated field names>\"
- Loads data from file, applies the query, returns array of objects with fields specified by '--params' flag.stto --json cpython | rjq --query=\"<query string>\" --params=\"<comma separated field names>\"
- Piping output from other program.
N.B. stto is a line of code counter used as an example here.
Query is set by --query
flag, e.g. --query=\"age > 30 && percentage >= 50.0\"
. rjq has a simple query structure, it follows [field_name] [operator] [Value]
pattern.
field_name
- It is the field name from the supplied dataset. For nested objects '.' operator should be used for accessing values, e.g. to access 'town' value from the following json:
{ \"_id\": \"88L33FM4VQBB1QYH\", \"address\": { \"postode\": \"CR45 9NE\", \"street\": \"3137 Stich Avenue\", \"town\": \"Swanley\" } }
use address.town
in the field_name of the query.
N.B. field_name
should not be wrapped in any quotes.
Operator
- The following operators are supported for now:
=
- equal_to
operator, checks if both sides are same.!=
- not_equals
operator, checks if both sides are NOT same.>
- greather_than
operator, checks if left
is greater than to right
.<
- less_than
operator, checks if left
is lesser than to right
.>=
- greather_than_or_equal
operator, checks if left
is greater than to right
or same.<=
- less_than_or_equal
operator, checks if left
is lesser than to right
or same.&&
- and
operator, joins two Binary expressions, e.g. age > 18 && percentage < 34.0
.||
- or
operator, joins two Binary expressions, e.g. age > 18 || percentage < 34.0
.Value
- rjq supports 3 types of values, string
, boolean
& number
.String
- strings should be wrapped in single quotes (') only, e.g. 'name'
, 'address'
etc.Boolean
- true
/false
without any quotes.Number
- Any number without quotes. For comparing decimal numbers decimal point should be provided, e.g. for quering age
& percentage
of the following - { \"age\": 30, ... \"percentage\": 56.34, ... }
use something like age > 18 && percentage > 50.0
.Output parameters are set by --params
flag e.g. --params=\"name, address.town\"
. Dot walking is supported for nested object fields.
src/\n main.rs # Entry point for the program.\n lexer.rs # Lexer of the program, tokenizes the query string.\n parser.rs # Parser of the program, creates Abstract syntax tree from the tokens generated by the lexer.\n interpreter.rs # Interprets the AST and returns boolean value after evaluating the query.\n helper.rs # Utility file.\n\nCargo.toml # Configuration file for the project.\n\nLICENSE # License file.\n\nREADME.md # Readme file.\n
"}]}
\ No newline at end of file
+{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Welcome to rjq","text":"rjq
is a simple and lightweight CLI JSON filtering tool designed for Windows and Linux.
--load
- Loads JSON data from file.--query
- Query to be performed on the dataset.--params
- Selects specific fields that will be returned as result.rjq --load=\"<file name>\"
- Loads JSON data from file and returns all the data as result.rjq --query=\"<query string>\"
- Sets query string.rjq --params=\"<comma separated field names>\"
- Sets fileds for the resultrjq --load=\"test.json\" --query=\"<query string>\" --params=\"<comma separated field names>\"
- Loads data from file, applies the query, returns array of objects with fields specified by '--params' flag.stto --json cpython | rjq --query=\"<query string>\" --params=\"<comma separated field names>\"
- Piping output from other program.
N.B. stto is a line of code counter used as an example here.
Query is set by --query
flag, e.g. --query=\"age > 30 && percentage >= 50.0\"
. rjq has a simple query structure, it follows [field_name] [operator] [Value]
pattern.
field_name
- It is the field name from the supplied dataset. For nested objects '.' operator should be used for accessing values, e.g. to access 'town' value from the following json:
{ \"_id\": \"88L33FM4VQBB1QYH\", \"address\": { \"postode\": \"CR45 9NE\", \"street\": \"3137 Stich Avenue\", \"town\": \"Swanley\" } }
use address.town
in the field_name of the query.
N.B. field_name
should not be wrapped in any quotes.
Operator
- The following operators are supported for now:
=
- equal_to
operator, checks if both sides are same.!=
- not_equals
operator, checks if both sides are NOT same.>
- greather_than
operator, checks if left
is greater than to right
.<
- less_than
operator, checks if left
is lesser than to right
.>=
- greather_than_or_equal
operator, checks if left
is greater than to right
or same.<=
- less_than_or_equal
operator, checks if left
is lesser than to right
or same.&&
- and
operator, joins two Binary expressions, e.g. age > 18 && percentage < 34.0
.||
- or
operator, joins two Binary expressions, e.g. age > 18 || percentage < 34.0
.Value
- rjq supports 3 types of values, string
, boolean
& number
.String
- strings should be wrapped in single quotes (') only, e.g. 'name'
, 'address'
etc.Boolean
- true
/false
without any quotes.Number
- Any number without quotes. For comparing decimal numbers decimal point should be provided, e.g. for quering age
& percentage
of the following - { \"age\": 30, ... \"percentage\": 56.34, ... }
use something like age > 18 && percentage > 50.0
.Output parameters are set by --params
flag e.g. --params=\"name, address.town\"
. Dot walking is supported for nested object fields.
src/\n main.rs # Entry point for the program.\n lexer.rs # Lexer of the program, tokenizes the query string.\n parser.rs # Parser of the program, creates Abstract syntax tree from the tokens generated by the lexer.\n interpreter.rs # Interprets the AST and returns boolean value after evaluating the query.\n helper.rs # Utility file.\n\nCargo.toml # Configuration file for the project.\n\nLICENSE # License file.\n\nREADME.md # Readme file.\n
"}]}
\ No newline at end of file