-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
18,827 additions
and
12,980 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# Getting Started | ||
|
||
MistQL is a miniature language for performing computations on JSON-like structures. | ||
|
||
MistQL's JavaScript implementation is built from the ground up to be included in clientside browser applications. It has no dependencies and has a total footprint of 5.3kB gzipped, making it suitable for size-sensitive frontends. | ||
|
||
## Installation | ||
|
||
The JavaScript implementation of MistQL is installed via the following: | ||
|
||
```shell | ||
npm install --save mistql | ||
``` | ||
|
||
The Python implementation of MistQL is installed via the following: | ||
|
||
```shell | ||
pip install mistql | ||
``` | ||
|
||
## Code usage | ||
|
||
MistQL's primary interface is through programatic access: | ||
|
||
```js | ||
// JavaScript | ||
import mistql from 'mistql'; | ||
|
||
const query = 'events | filter type == "purchase" | groupby email | keys'; | ||
const purchaserEmails = mistql.query(query, data); | ||
``` | ||
|
||
```py | ||
# Python | ||
import mistql | ||
|
||
query = 'events | filter type == "purchase" | groupby email | keys' | ||
purchaserEmails = mistql.query(query, data) | ||
``` | ||
|
||
## Command line usage | ||
|
||
MistQL exposes a command line interface under the name `mq`. `mq` can be installed globally via `npm install -g mistql`. | ||
|
||
The CLI can be used via `mq <query> [file]` | ||
|
||
If file is not provided, `mq` defaults to `stdin`. An example usage might be the following: | ||
|
||
```sh | ||
$ echo "[]" | mq "count @" | ||
> 0 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"label": "Reference", | ||
"position": 3 | ||
} |
Oops, something went wrong.