@@ -190,11 +190,11 @@ |
|
// Run this on the server |
String forDB = String.join(",", aggList); |
- LOG.info(forDB); |
+ LOG.fine(forDB); |
com.mongodb.DB mongoDB = mongo.getDB(db.getName()); |
String mongoCollection = getStringParam("mongo_collection"); |
CommandResult doEval = mongoDB.doEval("db.getCollection(\"" + mongoCollection + "\").aggregate([" + forDB + "])"); |
- LOG.info(doEval.toString()); |
+ LOG.fine(doEval.toString()); |
|
// doEval is { retval: "_batch": [results] |
DBObject retval = (DBObject) doEval.get("retval"); |
@@ -215,30 +215,6 @@ |
res.put("header", header); |
res.put("data", filtered); |
|
- String testJS = "db.getCollection(\"bigdata test series\").aggregate([" + |
-" { \"$match\": { \"location_id\": \"big_yearlychunks\" } }," + |
-" { \"$unwind\": \"$data\" }," + |
-" { \"$match\" : { \"data.0\" : { \"$gte\" : ISODate(\"2000-01-01\"), \"$lte\" : ISODate(\"2001-01-01\") } } }," + |
-" { \"$project\": {" + |
-" \"tmin\": { \"$arrayElemAt\": [\"$data\", 1] }," + |
-" \"month\": { $month: { \"$arrayElemAt\": [\"$data\", 0] } }," + |
-" \"year\": { $year: { \"$arrayElemAt\": [\"$data\", 0] } }," + |
-" } }," + |
-" { \"$group\": {" + |
-" \"_id\": { month: \"$month\", year: \"$year\" }," + |
-" \"tmin_avg\": { \"$avg\": \"$tmin\" }," + |
-" \"tmin_min\": { \"$min\": \"$tmin\" }," + |
-" \"tmin_max\": { \"$max\": \"$tmin\" }," + |
-" \"month\": { \"$first\": \"$month\" }," + |
-" \"year\": { \"$first\": \"$year\" }," + |
-" } }," + |
-" { \"$sort\": { \"year\": 1, \"month\": 1 } }," + |
-"])"; |
- //CommandResult doEval2 = mongoDB.doEval(testJS); |
- //LOG.info("test of " + testJS); |
- //LOG.info(doEval2.toString()); |
- |
- |
return res; |
} |
|