MongoDB shell如何修改預設顯示文件的項的個數

chenfeng發表於2016-07-05
用DBQuery.shellBatchSize命令,例如:
> DBQuery.shellBatchSize=30
30

這樣每頁就可以顯示30條文件記錄了:
> db.person.find()
{ "_id" : ObjectId("566682d98e31b1250ae8a9b4"), "name" : "duansf0", "age" : 0 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9b5"), "name" : "duansf1", "age" : 1 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9b6"), "name" : "duansf2", "age" : 2 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9b7"), "name" : "duansf3", "age" : 3 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9b8"), "name" : "duansf4", "age" : 4 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9b9"), "name" : "duansf5", "age" : 5 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9ba"), "name" : "duansf6", "age" : 6 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9bb"), "name" : "duansf7", "age" : 7 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9bc"), "name" : "duansf8", "age" : 8 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9bd"), "name" : "duansf9", "age" : 9 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9be"), "name" : "duansf10", "age" : 10 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9bf"), "name" : "duansf11", "age" : 11 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9c0"), "name" : "duansf12", "age" : 12 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9c1"), "name" : "duansf13", "age" : 13 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9c2"), "name" : "duansf14", "age" : 14 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9c3"), "name" : "duansf15", "age" : 15 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9c4"), "name" : "duansf16", "age" : 16 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9c5"), "name" : "duansf17", "age" : 17 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9c6"), "name" : "duansf18", "age" : 18 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9c7"), "name" : "duansf19", "age" : 19 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9c8"), "name" : "duansf20", "age" : 20 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9c9"), "name" : "duansf21", "age" : 21 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9ca"), "name" : "duansf22", "age" : 22 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9cb"), "name" : "duansf23", "age" : 23 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9cc"), "name" : "duansf24", "age" : 24 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9cd"), "name" : "duansf25", "age" : 25 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9ce"), "name" : "duansf26", "age" : 26 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9cf"), "name" : "duansf27", "age" : 27 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9d0"), "name" : "duansf28", "age" : 28 }
{ "_id" : ObjectId("566682db8e31b1250ae8a9d1"), "name" : "duansf29", "age" : 29 }

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15498/viewspace-2121518/,如需轉載,請註明出處,否則將追究法律責任。

相關文章