mongodb find 打印所有记录

 

>  db.VIDEO.find({vt:'ISYPLAYLIST',vdc:{$exists:false}},{_id:true}).count()
27

> var cursor = db.VIDEO.find({vt:'ISYPLAYLIST',vdc:{$exists:false}},{_id:true})                                                    
>  cursor.forEach(function(x) {
... 
...  print(x._id);
... 
...  });

//将结果存入cursor 

// 查找VIDEO集合。vt=ISYPLAYLIST 并且不存在vdc字段的数据,只返回_id字段

// 遍历打印结果


ISYPLAYLIST_8521
ISYPLAYLIST_11762
ISYPLAYLIST_13213
ISYPLAYLIST_12834
ISYPLAYLIST_13303
ISYPLAYLIST_12788
ISYPLAYLIST_12893
ISYPLAYLIST_12890
ISYPLAYLIST_12916
ISYPLAYLIST_13010
ISYPLAYLIST_12810
ISYPLAYLIST_13044
ISYPLAYLIST_13011
ISYPLAYLIST_13037
ISYPLAYLIST_12940
ISYPLAYLIST_13073
ISYPLAYLIST_13071
ISYPLAYLIST_13056
ISYPLAYLIST_13148
ISYPLAYLIST_13130
ISYPLAYLIST_13091
ISYPLAYLIST_13074
ISYPLAYLIST_13178
ISYPLAYLIST_13312
ISYPLAYLIST_13165
ISYPLAYLIST_13145
ISYPLAYLIST_13225