I am using Monary to connect to my MongoDB. but I am struggling to figure out where exactly and how to set the allowDiskUse option?
client = Monary("ip.address.of.server", 27017 , "username", "password", "dbname")
pipeline = [
{"$group" : {
"_id" : {"user":"$subscriber_id",
"month": { "$month" : "$timestamp" },
"day" : { "$dayOfMonth" : "$timestamp" },
"year" : { "$year" : "$timestamp" },
"hour" : { "$hour" : "$timestamp" },
"category":"$category_name"
},
"activities_sum":{"$sum":"$activity_count"}
}
}
]
with client as m:
users, years, months, days, hours, categories, activities = m.aggregate("digicel_exploration",
"5_min_slots",
time_aggregation_pipeline,
["_id.user", "_id.year", "_id.month", "_id.day", "_id.hour", "_id.category", "activities_sum"],
["string:30", "int32", "int32", "int32", "int32", "string:60", "int32"])