MongoDBMapReduce function is easy to use

Recently, I am doing statistical analysis of search query logs. For each query statistical log, I parse it out and store it in mongodb in a specific field format, and schedule it regularly to do some statistical analysis. One of the requirements is to count the number of queries of each query in a certain period of time (daily, weekly, and monthly), and display the popular query queries. Considering that the amount of data processed will not be large, the solution can also be simple. The method I use now is the MapReduce function of mongodb. In fact, this requirement can also be considered as a group operation, and the group function of mongodb is based on MapReduce, but the group has a limit on the size of the result set. This article introduces mongodb for an example MapReduce functionality. Grammar introduction MapReduce is a Command in mongodb, its syntax is as follows: db.runCommand( false>] [, finalize : ] [, scope : ] [, verbose : true] ); For this Command, I will not explain the three necessary parameters. For optional parameters, here is a brief description as follows: (1) query is very commonly used. It is used to filter…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: 34331943@QQ.com

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索