Note that there are some explanatory texts on larger screens.

plurals
  1. USKay
    primarykey
    data
    text
    plurals
    1. This table or related slice is empty.
    1. COHi Thomas - the development version 2.5.2 of MongoDB supports $out for aggregation which allows for output to a collection and is not under the 16mb limit. This version, which is for testing and not production purposes, may or may not work for you. In any case, the code would be db.bbticks.aggregate([ { $match: { time: { $gte: ISODate("2013-08-01") } } }, { $group: { _id: "$time", count: {$sum: 1}, tickers: { $push: { "ticker": "$ticker" , "close": "$close" } } } } , { $match: { count: { $gt: 1 } } }, { $out: "myAggResults"} ])
      singulars
    2. COHi Thomas - as you stated, because of the size limit, you probably should go with MapReduce. In regards to the logic of the aggregation, I first do a $match to find all the documents that match the condition of time >= "2013-08-01". Then, these matching documents are grouped by time, keeping a count and adding a field "tickers" which contain an array of tickers & closing price associated with that time. Then, from these grouping, I do another match to return only those that have count > 1.
      singulars
    3. COAlso, in your addGroupsForSubBusiness method, should you not be looping through the groups in your sub object, and adding to the list, instead of just adding initializing a group object with ?subBusiness name? dbGroupObj.put("group", sub.getName()); and adding just that one group to the groups list?
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload