view benchmark/find.js @ 215:1b3661be3119

change TreeMap compare & InterFace.find use Index find
author tatsuki
date Tue, 11 Aug 2015 08:16:07 +0900
parents 5aad7dbb390e
children
line wrap: on
line source

function findDataLoop () {
var date_obj = new Date();
var milliseconds = date_obj.getTime();
for (var i = 1; i<= 50000; i++) {
  var personData = db.person1.find({PersonId:"p:9"}).next();
  var roleId = personData.roleId
}
date_obj = new Date();
print(date_obj.getTime() - milliseconds)
}

function findData () {
  var personVer = db.config.find({configVer:"v:1"}).next().PersonVer;
  var personCollection = db.getCollection(personVer); 
  db.person1.find({PersonId:"p:9"}).next();
}