Skip to content
This repository has been archived by the owner on Jun 9, 2020. It is now read-only.

Commit

Permalink
0.5.3
Browse files Browse the repository at this point in the history
- Don’t want to use arrays in your aggregations? No problem, because
this:

```javascript
u.query({
        select: {
          $sum: {
            $sum: [
              {$max: ['tip', 'total’]},
              {$min: ['quantity', 'total’]}
            ]
          },
        }
      })
```
… is now easier written like this:

```javascript
u.query({
        select: {
          $sum: {
            $sum: {
              $max: ['tip', 'total'],
              $min: ['quantity', 'total']
            }
          },
        }
      })
```

- What’s that? Don’t like the verbosity of objects or arrays? Use the
new string syntax!

```javascript
universe.query({
        select: {
          $sum: '$sum($max(tip,total), $min(quantity,total))'
        }
      })
```
  • Loading branch information
tannerlinsley committed Mar 21, 2016
1 parent 9d698fe commit be833d7
Show file tree
Hide file tree
Showing 4 changed files with 173 additions and 56 deletions.
76 changes: 61 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ With Universe, you can be there in just a few lines of code. You've got better t
- [.add()](#api-add)
- [.remove()](#api-remove)

## [Pro Tips](#pro-tips)

## Getting Started
### Installation
**NPM**
Expand Down Expand Up @@ -171,21 +173,6 @@ As you filter your data on the universe level, every query's result is updated i

```

### Pre-compile Columns

Pro-Tip: You can also **pre-compile** column indices before querying. Otherwise, ad-hoc indices are created and managed automagically for you anyway.

```javascript
.then(function(myUniverse){
return myUniverse.column('a')
return myUniverse.column(['a', 'b', 'c'])
return myUniverse.column({
key: 'd',
type: 'string' // override automatic type detection
})
})
```

<h2 id="api">API <a href="#api">#</a></h2>

<h3 id="api-universe">universe( [data] , {config} ) <a href="#api-universe">#</a></h3>
Expand Down Expand Up @@ -301,3 +288,62 @@ Pro-Tip: You can also **pre-compile** column indices before querying. Otherwise,
- Returns
- `promise` resolved with
- **universe instance**


<h2 id="pro-tips">Pro Tips <a href="#pro-tips">#</a></h2>

#### No Arrays Necessary
Don’t want to use arrays in your aggregations? No problem, because this:

```javascript
u.query({
select: {
$sum: {
$sum: [
{$max: ['tip', 'total’]},
{$min: ['quantity', 'total’]}
]
},
}
})
```
… is now easier written like this:

```javascript
u.query({
select: {
$sum: {
$sum: {
$max: ['tip', 'total'],
$min: ['quantity', 'total']
}
},
}
})
```

#### No Objects Necessary, either!
What’s that? Don’t like the verbosity of objects or arrays? Use the new string syntax!

```javascript
universe.query({
select: {
$sum: '$sum($max(tip,total), $min(quantity,total))'
}
})
```

#### Pre-compile Columns

Pro-Tip: You can also **pre-compile** column indices before querying. Otherwise, ad-hoc indices are created and managed automagically for you anyway.

```javascript
.then(function(myUniverse){
return myUniverse.column('a')
return myUniverse.column(['a', 'b', 'c'])
return myUniverse.column({
key: 'd',
type: 'string' // override automatic type detection
})
})
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "universe",
"version": "0.5.2",
"version": "0.5.3",
"description": "The fastest way to query and explore multivariate datasets",
"main": "src/universe.js",
"directories": {
Expand Down
145 changes: 108 additions & 37 deletions universe.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions universe.min.js

Large diffs are not rendered by default.

0 comments on commit be833d7

Please sign in to comment.