Find Jobs
Hire Freelancers

MongoDB Expert: Migration script and aggregation pipeline

$30-250 USD

已完成
已发布超过 8 年前

$30-250 USD

货到付款
We need two tasks do be done: Short version: 1) Create a scheme migration script 2) Aggregate data using the db’s aggregation pipeline Long version: 1) Create scheme migration script The **current data scheme** of a collection which contains time series data is: Collection: data_raw_old { "_id" : ObjectId("558a7b789d712bd5f43e515d"), "dt" : { "week_of_year" : 26, "day_of_week" : 2, "hour" : 0, "year" : 2015, "timestamp" : ISODate("2015-06-24T00:05:00.000Z"), "day_of_year" : 175, "day" : 24, "minute" : 5, "month" : 6 }, "owner" : { "version" : "1.1", "type" : "plugin_object", "name" : "FunctionSourcePlugin", "id" : ObjectId("558a79d0d3da461d003c6ebb") }, "dtype" : "real", "modified" : ISODate("2015-06-24T11:42:16.440Z"), "values" : { "vel" : 5.6840797248015100 "temp" : 12.1 }, "created" : ISODate("2015-06-24T11:42:16.440Z") } The values-subdocument contains an varying number of key-value pairs, one per measurement. In the new scheme, we want to have one document per value. The document given above would yield two documents: Collection: data_raw_new { "_id" : "20150624000500000_FunctionSourceObject. [login to view URL]", "dtype" : "real", "modified" : ISODate("2015-06-24T11:42:16.440Z"), "value" : 5.6840797248015100, "sid" : "FunctionSourceObject. [login to view URL]", "owner" : "FunctionSourceObject. 558a79d0d3da461d003c6ebb", "dt" : ISODate("2015-06-24T00:05:00.000Z"), "created" : ISODate("2015-06-24T11:42:16.440Z") }, { "_id" : "20150624000500000_FunctionSourceObject. [login to view URL]", "dtype" : "real", "modified" : ISODate("2015-06-24T11:42:16.440Z"), "value" : 12.1, "sid" : "FunctionSourceObject. [login to view URL]", "owner" : "FunctionSourceObject. 558a79d0d3da461d003c6ebb", "dt" : ISODate("2015-06-24T00:05:00.000Z"), "created" : ISODate("2015-06-24T11:42:16.440Z") } Please note: - The new id is a combination of the dt-timestamp and the sid-value (sid = series id) - To construct the sid value, user [login to view URL], [login to view URL] and the respective value key. In the initial schema, all [login to view URL] values end with “Plugin”. This must be replaced by “Object” - A lot of fields and documents are removed The migration script can either be executed directly in mongodb, in python (using pymongo) or nodejs. 2) Aggregate data using aggregation pipeline The documents in the collection data_raw_new shall be aggregate in 1min, 5min, 15min, 1h, 24h and 7d buckets (collection names data_1min_new, data_5min_new etc.). An aggregated document in the data_1min_new collection might looks as follow: { "_id" : "20150624000500000_FunctionSourceObject. [login to view URL]", "dtype" : "real", "modified" : ISODate("2015-06-24T11:42:16.440Z"), "avg" : 5.1, "sum" : 8, "count" : 2, "min" : 2.9, "max" : 5.1, "sid" : "FunctionSourceObject. [login to view URL]", "owner" : "FunctionSourceObject. 558a79d0d3da461d003c6ebb", "dt" : ISODate("2015-06-24T00:05:00.000Z"), "created" : ISODate("2015-06-24T11:42:16.440Z") } The aggregation script will be executed regularly (e.g., every second minute), should query for documents in data_raw_new that have a modified date which is newer than the date when the aggregation command was executed last, compute aggregations and add them to the aggregation collection. It would be best if the aggregation could be run directly in mongodb. I do, however, not know if this is possible. If not, the command will be triggered from a python script. References that may be useful: - [login to view URL] - [login to view URL] - [login to view URL] - [login to view URL]
项目 ID: 9262450

关于此项目

4提案
远程项目
活跃8 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
颁发给:
用户头像
Hi, I am so much experienced with mongoDb in my day to day work for the past 3 years. I have did hundreds of such migrations and queries related to aggregation over the course of the time. Also I love working in MongoDb. I have also worked on a project involving time series data for storing the application metrics in mongoDb for a custom dashboard. It had also involved aggregation of older data in a RRD fashion. So, this problem is also similar to that and it so interesting to me. Also, I can get your work done with high quality in no time! Give me go and I'll get started.
$222 USD 在2天之内
5.0 (3条评论)
3.9
3.9
4威客以平均价$252 USD来参与此工作竞价
用户头像
Hi Employer, I have read your description and been interested in your project. Let me help you complete your 2 tasks. I'm ready to discuss and start to work on it now. ==================================== Please discuss before awarding the project.
$315 USD 在5天之内
4.9 (84条评论)
6.6
6.6
用户头像
I am a software engineer at CSC Vietnam. This is my first project to gain reputation therefore this is lower price than others. In addition, I have more three co-workers to help me make your project complete.
$222 USD 在7天之内
0.0 (0条评论)
0.0
0.0

关于客户

SWITZERLAND的国旗
Baar, Switzerland
5.0
40
付款方式已验证
会员自1月 25, 2010起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。