명령프롬프트1
mongod --dbpath C:\\devtools\\python_work\\mongodb\\data
명령프롬프트2
mongo
show dbs
use jsp(해당 데이터베이스 명)
var map_function=function() {emit(this.city_or_province, this.population);}
var reduce_function=function(keyCityOrProvince, valuesPopulation){
return Array.sum(valuesPopulation);
}
db.area.mapReduce(
map_function,
reduce_function,
{out:"area_population_total"}
)
db.area_population_total.find()