Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/wcandillon/jsoniq-mongodb-examples

JSONiq Query Examples for MongoDB
https://github.com/wcandillon/jsoniq-mongodb-examples

Last synced: about 1 month ago
JSON representation

JSONiq Query Examples for MongoDB

Awesome Lists containing this project

README

        

#JSONiq Query Examples for MongoDB

##Configure & Run
In order to run these examples, you need to create an account on http://28.io.
You also need to install the 28 CLI tool:
```bash
$npm install 28 -g
$28 login [email protected]
```

You can then edit the mongodb-config.json file with the credential of your own MongoDB.

To create a project and attach your MongoDB:
```bash
$28 projects create my-project
$28 datasources set my-project -c mongodb-config.json
```

To upload the queries:
```bash
$cd queries/
$28 upload my-project
```

To run a query:
```bash
$cd queries/
$28 run my-project public/top_contributors.jq
```

## JSONiq Development
The Atom and Cloud9 editors have great support for JSONiq.
The Atom extension for JSONiq is available [here](https://atom.io/packages/language-jsoniq).

The `28 watch` command will deploy your queries to 28.io everytime they are updated locally.
```bash
$cd queries/
$28 watch my-project
```

For continuous integration, there is a gulp task to perform static code analysis on your queries: [gulp-xqlint](https://github.com/wcandillon/gulp-xqlint). And example of integration between 28.io and gulp is available [here](https://github.com/28msec/cellstore/blob/master/tasks/28.js).