准备工作: 先插入100万条数据for(i=0;i<=1000000;i++){ db.users.insert({ "i":i, "username":"user"+i, "age":Math.floor(Math.random()...
分类:
数据库 时间:
2014-08-05 13:54:29
阅读次数:
268
添加记录--insert1.向用户表(user)中添加一条记录varuser={“username”:”Tom”,“age”:10};à对象(json)db.user.insert(user);à向user(集合)中插入记录2.向用户集合中插入一条日志记录varblog={“title”:”title1”,”content”:”content1”,”addtime”:”2012”}db.u..
分类:
数据库 时间:
2014-08-05 03:14:59
阅读次数:
309
BAge SortInput:Standard InputOutput:Standard OutputYou are given the ages (in years) of all people of a country with at least 1 year of age. You know ...
分类:
其他好文 时间:
2014-08-05 02:57:48
阅读次数:
230
//json转换成oc对象 NSString *jsonStr= @"{\"name\":\"Zhangsan\",\"age\":20,\"dog\":{\"name\":[\"XiaoHei\", \"XiaoQiang\"]}}"; NSData *data=[jsonStr d...
分类:
Web程序 时间:
2014-08-05 00:16:28
阅读次数:
275
post请求的请求体有以下两种格式:1. 字符串:'name=code_bunny&age=12' 这种格式的请求体,需要配置请求头'Content-Type':'application/x-www-form-urlencoded'2. json: {name:'code_bunny',age:1....
分类:
其他好文 时间:
2014-08-04 13:32:17
阅读次数:
246
JS 对象:var person = { firstname : "Bill", lastname : "Gates", age : 56};var person = new Object();person.firstname = "Bill";person.lastname = ...
分类:
Web程序 时间:
2014-08-03 23:12:56
阅读次数:
314
在php中使用 json_encode() 内置函数可以使用得php中的数据更好的与其它语言传递与使用。这个函数的功能是将数组转换成json数据存储格式:1 'Balla_兔子','age'=>22);3 echo json_encode($arr);4 ?>输出结果:1 {"name":"...
分类:
Web程序 时间:
2014-08-03 18:00:45
阅读次数:
213
,pragma与no-cache用于定义页面缓存,不缓存页面(为了提高速度一些浏览器会缓存浏览者浏览过的页面,通过下面的定义,浏览器一般不会缓存页面,而且浏览器无法脱机浏览.),常见的取值有private、no-cache、max-age、must-revalidate等,默认为private,其作...
分类:
Web程序 时间:
2014-08-03 17:41:15
阅读次数:
256
前几天用的结构体,结构体内还包含有结构体指针和数组以及指向字符串的指针,发现自己对这方面的东西还很容易犯错,故现在讲其中容易出错的地方写出来,分享给大家也方便自己日后查看。
typedef struct {
char name[50];
char job[50];
int age;
int people_id;
} peopleInfo;
typedef struct...
分类:
其他好文 时间:
2014-08-03 15:21:35
阅读次数:
190
1 find find({查询条件},{"key":1,"email":1})? 后面表示返回哪些键 2 可用的比较操作符 $lt , $lte,$gt,$gte 比如db.users.find({"age":{"$gte":18,"$lte":30}}) 3不等于 find(...{"key":{"$ne":"value"}} 4 ...
分类:
数据库 时间:
2014-08-03 10:23:35
阅读次数:
312