大量json dummydataをcloudantDBに格納~(超初心者向け)

-----作成中、完成版ではない-----

##■JSON API
[API Ref](https://docs.cloudant.com/document.html#documentCreate)


##■dummydataの生成
例：

```javascript:dummydata.js
for (i=0;i<500;i++){
	var dummydata={};
	dummydata.type = "answer";
	dummydata.sex = "";
	  var  sex=Math.floor(Math.random()*2)+0;
		for (a=0;a<500;a++){
			if(sex==0){
				dummydata.sex="women";
			} else {
				dummydata.sex="men";
			}
    }
	dummydata.age =Math.floor(Math.random()*70)+10;
	console.log("age:"+dummydata.age);
	dummydata.date="";
	  var  date=Math.floor(Math.random()*3)+0;
		console.log("date:"+date);
	  for (b=0;b<5;b++){
		 if(date>=2){
			dummydata.date="20171028";
		} else if(date>=1&&date<2){
			dummydata.date="20171029";
		} else {
			dummydata.date="20171030";
		}
	}
	dummydata.staff=Math.floor(Math.random()*15)+10000000;
	console.log("staff:"+dummydata.staff);
	dummydata.marriage="";
	  var  marriage=Math.floor(Math.random()*2)+0;
	  for (c=0;c<5;c++){
		 if(marriage==0){
			dummydata.marriage="married";
		} else {
			dummydata.marriage="unmarried";
		}
	}
	console.log("marriage:"+marriage);
	dummydata.yearOfExperience=Math.floor(Math.random()*60)+0;
  dummydata.license="";
	  var license =Math.floor(Math.random()*2)+0;
		for (c=0;c<5;c++){
		 if(license>=2){
			dummydata.license="scooterLicense";
		} else if(date>=1&&date<2){
			dummydata.license="smallLicense";
		} else {
			dummydata.license="middleLicense";
		}
	}
	dummydata.Answers = [
		{
		qGr:'11',
		answer:'いいと思う'
	},
	 {
	 qGr:'22',
	 answer:'まあまあ'
	}
]
	dummydata.commonAnswers = [
		{
		qNo:'1',
		answer:'いいと思う'
	},
	 {
	 qNo:'2',
	 answer:'まあまあ'
	}
]

	dummydata.talk = function(){console.log('hello');};

	var toStr = JSON.stringify(dummydata);
	document.write(toStr+",");
};
	console.log('--------------------------------------------------------------');

  var alice = nano.use('alice')
  alice.insert({ _id: 'myid', happy: true }, function(err, body) {
    if (!err)
      console.log(body)
  })
//

```

##■複数JSONの格式
{
 "docs":[
{
json data1
},
{
json data2
}]}

生成した json dummydata の例

```json:dummydata
{"docs": [{"type":"answer","sex":"men","age":34,"date":"20171029","staff":10000011,"marriage":"married","yearOfExperience":19,"license":"smallLicense","Answers":[{"qGr":"11","answer":"いいと思う"},{"qGr":"22","answer":"まあまあ"}],"commonAnswers":[{"qNo":"1","answer":"いいと思う"},{"qNo":"2","answer":"まあまあ"}]},{"type":"answer","sex":"women","age":40,"date":"20171029","staff":10000011,"marriage":"married","yearOfExperience":43,"license":"smallLicense","Answers":[{"qGr":"11","answer":"いいと思う"},{"qGr":"22","answer":"まあまあ"}],"commonAnswers":[{"qNo":"1","answer":"いいと思う"},{"qNo":"2","answer":"まあまあ"}]},{"type":"answer","sex":"women","age":20,"date":"20171029","staff":10000001,"marriage":"unmarried","yearOfExperience":12,"license":"smallLicense","Answers":[{"qGr":"11","answer":"いいと思う"},{"qGr":"22","answer":"まあまあ"}],"commonAnswers":[{"qNo":"1","answer":"いいと思う"},{"qNo":"2","answer":"まあまあ"}]},{"type":"answer","sex":"women","age":23,"date":"20171030","staff":10000004,"marriage":"married","yearOfExperience":29,"license":"middleLicense","Answers":[{"qGr":"11","answer":"いいと思う"},{"qGr":"22","answer":"まあまあ"}],"commonAnswers":[{"qNo":"1","answer":"いいと思う"},{"qNo":"2","answer":"まあまあ"}]},{"type":"answer","sex":"men","age":76,"date":"20171030","staff":10000002,"marriage":"unmarried","yearOfExperience":27,"license":"middleLicense","Answers":[{"qGr":"11","answer":"いいと思う"},{"qGr":"22","answer":"まあまあ"}],"commonAnswers":[{"qNo":"1","answer":"いいと思う"},{"qNo":"2","answer":"まあまあ"}]},{"type":"answer","sex":"men","age":72,"date":"20171030","staff":10000011,"marriage":"married","yearOfExperience":34,"license":"middleLicense","Answers":[{"qGr":"11","answer":"いいと思う"},{"qGr":"22","answer":"まあまあ"}],"commonAnswers":[{"qNo":"1","answer":"いいと思う"},{"qNo":"2","answer":"まあまあ"}]},{"type":"answer","sex":"men","age":72,"date":"20171030","staff":10000009,"marriage":"married","yearOfExperience":10,"license":"middleLicense","Answers":[{"qGr":"11","answer":"いいと思う"},{"qGr":"22","answer":"まあまあ"}],"commonAnswers":[{"qNo":"1","answer":"いいと思う"},{"qNo":"2","answer":"まあまあ"}]},{"type":"answer","sex":"women","age":10,"date":"20171030","staff":10000002,"marriage":"married","yearOfExperience":53,"license":"middleLicense","Answers":[{"qGr":"11","answer":"いいと思う"},{"qGr":"22","answer":"まあまあ"}],"commonAnswers":[{"qNo":"1","answer":"いいと思う"},{"qNo":"2","answer":"まあまあ"}]},{"type":"answer","sex":"men","age":18,"date":"20171029","staff":10000005,"marriage":"unmarried","yearOfExperience":43,"license":"smallLicense","Answers":[{"qGr":"11","answer":"いいと思う"},{"qGr":"22","answer":"まあまあ"}],"commonAnswers":[{"qNo":"1","answer":"いいと思う"},{"qNo":"2","answer":"まあまあ"}]},{"type":"answer","sex":"men","age":21,"date":"20171029","staff":10000000,"marriage":"unmarried","yearOfExperience":9,"license":"smallLicense","Answers":[{"qGr":"11","answer":"いいと思う"},{"qGr":"22","answer":"まあまあ"}],"commonAnswers":[{"qNo":"1","answer":"いいと思う"},{"qNo":"2","answer":"まあまあ"}]},{"type":"answer","sex":"women","age":63,"date":"20171028","staff":10000007,"marriage":"married","yearOfExperience":11,"license":"middleLicense","Answers":[{"qGr":"11","answer":"いいと思う"},{"qGr":"22","answer":"まあまあ"}],"commonAnswers":[{"qNo":"1","answer":"いいと思う"},{"qNo":"2","answer":"まあまあ"}]},{"type":"answer","sex":"women","age":38,"date":"20171028","staff":10000014,"marriage":"unmarried","yearOfExperience":51,"license":"middleLicense","Answers":[{"qGr":"11","answer":"いいと思う"},{"qGr":"22","answer":"まあまあ"}],"commonAnswers":[{"qNo":"1","answer":"いいと思う"},{"qNo":"2","answer":"まあまあ"}]}]}

```
##■複数の場合
例：
アカウント名：aaaa
パスワード：bbbb
データベース名：test123_db
https://aaaa:bbbb@aaaa-bluemix.cloudant.com/test123_db/_bulk_docs

##■単数の場合
例：
アカウント名：aaaa
パスワード：bbbb
データベース名：test123_db
https://aaaa:bbbb@aaaa-bluemix.cloudant.com/test123_db

## ■ポスターの使い方

追加予定