loyung

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

第一种方法

var lst = db.visits_201501.find({
    "url":/http:\/\/m.baidu.com\/application/
    });
while(lst.hasNext())
{
    db.hyyy_2015.insert(lst.next());
    }

第二种

db.visits_201501.find({
        $or:[{"url":{$regex:/http:\/\/(www|m).baidu.com\/netshow\/(.*)\/news(.*).htm/}},
        {"url":{$regex:/http:\/\/www.baidu.com\/hot\/(.*)/}}]
        }).forEach(function(x){
    db.hyyy.insert(x);
    })

 

posted on 2017-11-22 14:37  loyung  阅读(565)  评论(0编辑  收藏  举报