Hacking Chess with the MongoDB Pipeline
Kristina Chodorow* writes:
MongoDB’s new aggegation framework is now available in the nightly build! This post demonstrates some of its capabilities by using it to analyze chess games.
Make sure you have a the “Development Release (Unstable)” nightly running before trying out the stuff in this post. The aggregation framework will be in 2.1.0, but as of this writing it’s only in the nightly build.
First, we need some chess games to analyze. Download games.json, which contains 1132 games that were won in 10 moves or less (crush their soul and do it quick).
You can use mongoimport to import games.json into MongoDB:
If you think this example of “aggregation” as merging where the subjects have a uniform identifier (chess piece/move), you will understand why I find this interesting.
Aggregation, as is shown by Kristina’s post, can form the basis for analysis of data.
Analysis that isn’t possible in the absence of aggregation (read merging).
I am looking forward to addition posts on the aggregation framework and need to drop by the MongoDB project to see what the future holds on aggregation/merging.
*Kristina is the author of two O’Reilly titles, MongoDB: the definitive guide and Scaling MongoDB.