view mongoBenchMark/insertData.js @ 25:69dca2ab1783

add mongoBenchMark script
author tatsuki
date Mon, 04 May 2015 00:20:18 +0900
parents
children
line wrap: on
line source

use tatsuki
db.collection.drop();
for (var i = 1; i<= 100 ; i++) {

    var user = {
   
    PersonId: "p:" + String(i),
    type: "Person",
    accountId: "a:26",
    lastName: "LastName",
    name: "name",
    nameReading: "nameReading",
    roleRefIds: [
        "r:10",
        "r:34"
      ]
    ,
    parentOrganizations: {
      type: "OrganizationMappedByRole",
      OrganizationMappedByRole: [
        {
          type: "OrganizationMappedByRole",
          organizationRefId: "o:2",
          roleRefId: "r:10"
        },
        {
          type: "OrganizationMappedByRole",
          organizationRefId: "o:11",
          roleRefId: "r:34"
        }
      ]
    },
    priorities: {
      type: "PriorityMappedByRole",
      PriorityMappedByRole: [
        {
          type: "PriorityMappedByRole",
          priority: "0",
          roleRefId: "r:10"
        },
        {
          type: "PriorityMappedByRole",
          priority: "1",
          roleRefId: "r:34"
        }
      ]
    }
};

    db.collection.insert(user);
}
print("insertEnd");
db.collection.createIndex({PersonId:1});