【MongoDB】探討《MongoDB權威指南》書籍中的幾點錯誤,mongodb權威指南

來源:互聯網
上載者:User

【MongoDB】探討《MongoDB權威指南》書籍中的幾點錯誤,mongodb權威指南

今天進一步學習MongoDB,學習資料是《MongoDB權威指南》,詳細見如下封面:

在閱讀過程中發現了如下錯誤:

第一處:P29頁批量插入,在書中講到可以利用batchInsert函數實現批量插入,我運行時候發現系統提示沒有這個方法。我用的軟體是2.6.4.我以為是版本過低,然後下載2.6.6 最新版本進行測試,報同樣的錯誤;

Property 'batchInsert' of object student.students is not a function

後來查詢用命令:db.students.help()查詢了集合操作的所有方法,沒有找到batchInsert這個方法;

 

第二處: P31頁,在刪除速度中,倒數最後一行。db.tester.remove(), db.findOne();

db.findOne(); 這個方法在這裡不能用,如果按照這個寫直接報錯,應該寫成db.tester.findOne();

第三處:P62頁,返回一個匹配的數組元素:我按照書上面的操作,結果報錯,無論也調試不成:

 

本人執行個體:

 

後記:真心告訴想學習mongodb的小夥伴,不要用這本書作為學習材料。裡面的錯誤內容很多,請大家注意

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.