Database Reference
In-Depth Information
For our current purposes, let's output to the screen so we can see exactly what is going on. To do this, we pass a
document with the out option that has a value of { inline : 1 } , like this:
{ out : { inline : 1 } }
This gives us the following command:
db.mapreduce.mapReduce(map,reduce,{ out: { inline : 1 } });
The result looks like this:
{
"results" : [
{
"_id" : "black",
"value" : null
},
{
"_id" : "blue",
"value" : null
},
{
"_id" : "brown",
"value" : null
},
{
"_id" : "green",
"value" : null
},
{
"_id" : "grey",
"value" : null
},
{
"_id" : "maroon",
"value" : null
},
{
"_id" : "orange",
"value" : null
},
{
"_id" : "purple",
"value" : null
},
{
"_id" : "red",
"value" : null
},
{
"_id" : "white",
"value" : null
Search WWH ::




Custom Search