MongoDB MapReduce Combat <1>

Source: Internet
Author: User
Tags mongodb support
requirements, MySQL table, a log table, the average record of statistical data cycle, in practice to learn, with MySQL may be more trouble, then use just contact with the MongoDB bar, but also with the study of Hadoop last year stained point, and MongoDB support MapReduce, I've been wanting to get to know each other last year, but I'm too busy and have no time to study it right now. Using the command line is tiring, so use the Mongovue tool. The start:
Analysis table structure, useful fields one is record ID (repeatable), one is the time that record produces, import the required fields and data into MongoDB, write the first mapreduce, the time that the record produces merges, form like:
{"ID": "1001", "Dates": [' 2014/2/10 ', ' 2014/2/9 ', ' 2014/2/6 ']}
Write a second mapreduce, the time of each record for the mean operation, such as the above is used:
(February 10-February 9) + (February 9-February 6)) divided by 2
Finally, all records are again the first step, to import data steps (borrowed online to find the picture): choose MySQL Database
Establishing a database connection
Select Table
Select field
Complete
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.