MongoDB學習:(二)MongoDB簡單使用

來源:互聯網
上載者:User

標籤:

MongoDB學習:(二)MongoDB簡單使用 MongoDB使用:
執行mongodb的操作之前,我們需要運行命令,來進入操作命令介面>mongo
提示該錯誤,說明我們系統缺少一個補丁,該補丁我百度盤串連為:https://pan.baidu.com/s/1pKPyPoJ官方地址為:http://hotfixv4.microsoft.com/Windows%207/Windows%20Server2008%20R2%20SP1/sp2/Fix405791/7600/free/451413_intl_x64_zip.exeHotfix KB2731284 or later update is not installed這個問題,從官方文檔的另一段話:If you are running any edition of Windows Server 2008 R2 or Windows 7, please installa hotfix to resolve an issue with memory mapped files on Windows.大意是:如果您啟動並執行是任何版本的Windows Server 2008 R2或Windows 7,請安裝修復程式來解決一個記憶體對應檔在Windows的問題。

1:安裝補丁下載好後,雙擊,會解壓出來一個補丁檔案,安裝該補丁檔案。安裝完需要重啟.....(安裝完貌似也還是報這個錯,貌似不影響使用。以後在研究)


MongoDB簡單使用:
啟動mongodb:>mongo查看當前資料庫資訊>show dbs建立資料庫,名字隨意 use+資料庫名字>use firstdb

Mongodb插入資料 Insert:
>db.people.insert({"name":"表格1的資料","text":123456})       在firstdb庫的集合people中插入文檔(mongodb資料都是文檔性質)


Mongodb查看資料 Select--find:
>db.people.find()  尋找所有資料
>db.people.find({"text":9999})  

Mongodb修改資料 update:
>db.people.update  ,不解釋了

Mongodb刪除資料 remove:
>db.people.remove  ,不解釋了

如上,就是MongoDB的基本操作,後續一章寫點啥,還沒想好,想好了再更新。

來自為知筆記(Wiz)

MongoDB學習:(二)MongoDB簡單使用

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.