Pagerank algorithm with mapreduce mongoDB + nodeJS
npm install
yarn install
To prepare databse
npm run build
To run the pagerank mapreduce algorithm and see the result in terminal
npm run start
In mongo functions you can't access console var, but mongoDB provides us a print statement though: print('statement') To see the log file on Mac OS
tail -f /usr/local/var/log/mongodb/mongo.log
Otherwise you can specify the log file path when starting mongo daemon (mongod) process
mongod --logpath D:\path\to\log.txt
You have example of graph to generate in methods folder named 'genDatas'. Run following to save in mongoDB
node methods/genDatas.js
You can remove all datas with
node methods/removeDatas.js