mongoDB map/reduce minus the reduce

后端 未结 5 1814
清歌不尽
清歌不尽 2021-02-01 21:02

I have some 25k documents (4 GB in raw json) of data that I want to perform a few javascript operations on to make it more accessible to my end data consumer (R), a

5条回答
  •  南笙
    南笙 (楼主)
    2021-02-01 21:32

    When you got access to the mongo shell, it accepts some Javascript commands and then it's simpler:

    map = function(item){
            db.result.insert(item);
    }
    
    db.collection.find().forEach(map);
    

提交回复
热议问题