Getting data from MongoDB
Moving data out of MongoDB is a tad trickier than putting data into the NoSQL database. Fortunately, we are able to filter out data to produce a smaller subset of a source document store.
Getting ready
We will be pulling a subset of data from the batting dataset loaded from the Lahman's Baseball Database in the recipe, Loading data into MongoDB. It will also be beneficial to read more on MongoDB's data model. There is a good overview provided by the MongoDB website at http://docs.mongodb.org/manual/core/data-modeling/.
How to do it...
Open a new transformation.
Under the Big Data category, select the MongoDb input step and bring it over to the canvas.
Open the step and add the MongoDB instance connection information to the Host name or IP address and Port.
Enter
baseball
for the Database field andbatting
for the Collection field.For the Query expression (JSON) field, enter
{"$query" : {"G_batting" : {"$gte" : 10 }}, "$orderby" : {"playerID" : 1, "yearID": 1} }
. This...