2016-09-19 55 views
0

一種方法中格式化的方式來顯示結果是相當()method.But,我有 以下與方法錯誤漂亮()顯示結果格式化方式MongoDB中

db.mycol.find()。漂亮( )

{

... 「稱號」: 「MongoDB是沒有SQL數據庫」,

...... 「經」: 「教程點」,

... 「URL」: 「http://www.tutorilaspoint.com」,

... 「標籤」: 「mongodb的」, 「dtabase」, 「NoSQL的」],

... 「喜歡」: 「100」

...}

2016-09-19T16:31:34.779 + 0545語法錯誤:意外令牌:

+0

提供代碼 – Beginner

+0

其從tutorialspoint> db.mycol.find()漂亮(){ 「_id」 相同的代碼:的ObjectId(7df78ad8902c), 「稱號」: 「MongoDB的概述」, 「的說明「:」MongoDB is no sql database「, 」by「:」tutorials point「, 」url「:」http://www.tutorialspoint.com「, 」tags「:[」mongodb「,」database「 「NoSQL的」], 「喜歡」: 「100」 } > –

+1

應該是'漂亮()'代替'preety()' –

回答

2

您的意思是db.mycol.find().pretty()

+0

是先生,但它給出了錯誤 –

+0

它應該給出錯誤當你的集合不存在並且來自find()的鏈斷裂時。但除此之外,我沒有任何線索。 –