MongoDB性能测试代码
写入100万条记录,建立索引,使用索引连续查询 10万次。[*]use admin;//连接资料库
[*]db.auth("mongoAdmin","123456");//登录
[*]use test;//连接测试库
[*]db.test_collection.dropIndexes();
[*]db.test_collection.drop();
[*]print("insert begin: "+Date());//写入开始时间
[*]people = ["Marc", "Bill", "George", "Eliot", "Matt", "Trey", "Tracy", "Greg", "Steve", "Kristina", "Katie", "Jeff"];
[*]for(var i=10; i
页:
[1]