Skip to main content
Version: Streamsheets 3.0

MONGO.AGGREGATE

Gets aggregated data from your Mongo database. You can use the Function Wizard to create this function. Operators for the query aggregations can be found here.

Syntax

=MONGO.AGGREGATE(Connection, Collection, Aggregate JSON, Target, [Result Keys], [Timeout])

Arguments

NameTypeDescription
ConnectionConnectionReference to connection used for aggregating. The database name is configured in the affiliated connection settings.
CollectionStringChoose an existing collection, where the items are stored.
Aggregate JSONJSONDefine an aggregation using a JSON cell range.
TargetTargetINBOX(), OUTBOX("MsgID") or a cell range where the result will be placed. Make sure the cell range is big enough or not everything is displayed.
Result Keys (optional)RangeFilter the result.
Timeout (optional)NumberDefine Timeout in seconds.

Return

TRUE, if no error.

Examples

ABCDE
1Collection:REP_SALES
2customeridF7ZF50
3Reward_programTRUE$match
4Total spent money2116Total spent money
5$gt1500
6MONGO.STORE1
7$group
8_idTotal_id$Reward_program
9TRUE41053Total
10FALSE15724$sum$Total spend money
11
12MONGO.AGGREGATE
FormulaResultComment
=MONGO.AGGREGATE(MongoConnection!,B2, JSON(D2:E10),A8:B13)
In A8:B13Divides the result in two groups, which calculate the total sales above 1500 Euro.