-
Notifications
You must be signed in to change notification settings - Fork 71.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2247 from nightscout/dev
0.9.1 (Grilled Cheese)
- Loading branch information
Showing
109 changed files
with
5,758 additions
and
1,277 deletions.
There are no files selected for viewing
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
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
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
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
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,32 @@ | ||
var find_options = require('./query'); | ||
|
||
function create (conf, api) { | ||
|
||
var template = function ( ) { | ||
return [ | ||
{ | ||
$group: { | ||
_id: null | ||
, count: { $sum: 1 } | ||
} | ||
} | ||
]; | ||
}; | ||
|
||
// var collection = api( ); | ||
function aggregate (opts, done) { | ||
var query = find_options(opts); | ||
|
||
var pipeline = (conf.pipeline || [ ]).concat(opts.pipeline || [ ]); | ||
var groupBy = [ {$match: query } ].concat(pipeline).concat(template( )); | ||
console.log('$match query', query); | ||
console.log('AGGREGATE', groupBy); | ||
api( ).aggregate(groupBy, done); | ||
} | ||
|
||
return aggregate; | ||
|
||
} | ||
|
||
module.exports = create; | ||
|
Oops, something went wrong.