新聞中心
Hello,大家好。我是吳老板。

創(chuàng)新互聯公司專注于崇仁企業(yè)網站建設,成都響應式網站建設公司,成都商城網站開發(fā)。崇仁網站建設公司,為崇仁等地區(qū)提供建站服務。全流程按需定制設計,專業(yè)設計,全程項目跟蹤,創(chuàng)新互聯公司專業(yè)和態(tài)度為您提供的服務
前言
MongoDB 是非關系型數據庫的代表,一款基于鍵值儲存的高性能數據庫。常作為爬蟲儲存數據庫。
MongoDB 是一個基于分布式文件存儲的數據庫。由 C++ 語言編寫。旨在為 WEB 應用提供可擴展的高性能數據存儲解決方案。
MongoDB 是一個介于關系數據庫和非關系數據庫之間的產品,是非關系數據庫當中功能最豐富,最像關系數據庫的。
參考資料:
https://www.runoob.com/mongodb/mongodb-tutorial.html
連接 MongoDB
格式: mongodb://username:password@host:port/database
- mongodb://:固定的連接頭,必須要指定。
- username:password:用戶名密碼驗證,如果密碼為空可不填
- host:指定host, URI 是唯一必填項。它指定了要連接服務器的地址。
- port:指定端口,如果不填,默認為 27017
- database:若不指定,默認打開 test 數據庫。
創(chuàng)建數據庫、集合
嘗試創(chuàng)建數據庫 地下交通站
我們使用中文命名我們的第一個數據庫
- > use 地下交通站
- switched to db 地下交通站
- > db
- 地下交通站
如果該數據庫已存在則會切換到此庫,如果沒有,則創(chuàng)建。
查看數據庫列表
- > show dbs
- admin 0.000GB
- config 0.000GB
- local 0.000GB
在 MongoDB中,數據庫必須要有數據才能在列表中看到它,這一點和其他數據庫還是有很大的不同,我們將在稍后嘗試插入數據。
嘗試創(chuàng)建集合 Quotations
- > db.createCollection("Quotations")
- { "ok" : 1 }
這樣一個集合就創(chuàng)建成功了。
查看 數據庫地下交通站 中的所有集合
- > show collections
- Quotations
刪庫就更簡單了,跑路才難 !!
刪除一個數據庫
- > use 地下交通站
- switched to db 地下交通站
- > db.dropDatabase()
- { "dropped" : "地下交通站", "ok" : 1 }
這樣一個MongoDB數據庫就沒了。
刪除一個集合
- > use 地下交通站
- switched to db 地下交通站
- > db.Quotations.drop() # 刪除集合
這樣數據庫地下交通站 中的Quotations集合就沒了 !
插入文檔
MongoDB 是一個面向文檔存儲的數據庫,操作起來比較簡單和容易。
MongoDB 中一條數據被視為一個文檔,而一個表則被稱為一個集合(Collection)。
db.collection.insertOne() 用于向集合插入一個新文檔(單個json對象)
db.collection.insertMany() 用于向集合插入一個多個文檔(json對象列表)
嘗試插入一條數據
在數據庫地下交通站中的Quotations 集合中插入一條數據
- > use 地下交通站
- switched to db 地下交通站
- > db.Quotations.insert({
- name: '賈貴',
- description: '老子在這欠的飯錢夠你吃二年的',
- createDate: '2021-04-15'
- })
- WriteResult({ "nInserted" : 1 })
查看已插入文檔記錄
- > db.Quotations.find({})
- { "_id" : ObjectId("6078e9743252cc07e092d204"), "name" : "賈貴", "description" : "老子在這欠的飯錢夠你吃二年的", "createDate" : "2021-04-15" }
可以看到 MongoDB 集合自動幫我們生成了 _id 字段用于唯一索引 !!
嘗試插入多條數據
- > db.Quotations.insertMany([
- {name: '黃金標',description: '這秤砣也TM燉熟了',createDate: '2021-04-15'},
- {name: '賈貴',description: '我捂著腦袋捂著臉撅著屁股就跟他打起來了',createDate: '2021-04-16'},
- {name: '黑藤',description: '你說我他么是誰,我他么是黑藤',createDate: '2021-04-16'},
- {name: '孫友福',description: '沒有水就沒有魚,沒有你就沒有驢',createDate: '2021-04-17'}
- ])
- > db.Quotations.find({})
- { "_id" : ObjectId("6078e9743252cc07e092d204"), "name" : "賈貴", "description" : "老子在這欠的飯錢夠你吃二年的", "createDate" : "2021-04-15" }
- { "_id" : ObjectId("6078ebd395708b77ad7a8bd8"), "name" : "黃金標", "description" : "這秤砣也TM燉熟了", "createDate" : "2021-04-15" }
- { "_id" : ObjectId("6078ebd395708b77ad7a8bd9"), "name" : "賈貴", "description" : "我捂著腦袋捂著臉撅著屁股就跟他打起來了", "createDate" : "2021-04-16" }
- { "_id" : ObjectId("6078ebd395708b77ad7a8bda"), "name" : "黑藤", "description" : "你說我他么是誰,我他么是黑藤", "createDate" : "2021-04-16" }
- { "_id" : ObjectId("6078ebd395708b77ad7a8bdb"), "name" : "孫友福", "description" : "沒有水就沒有魚,沒有你就沒有驢", "createDate" : "2021-04-17" }
更新文檔
嘗試更新 name 字段(單條文檔)
- > db.Quotations.update({'name':'黑藤'},{$set:{name: '黑藤',description: '天下漢奸一般蠢',createDate: '2021-04-16'}})
更改生效
- > db.Quotations.find({}) 1-04-16'}})
- { "_id" : ObjectId("6078e9743252cc07e092d204"), "name" : "賈貴", "description" : "老子在這欠的飯錢夠你吃二年的", "createDate" : "2021-04-15" }
- { "_id" : ObjectId("6078ebd395708b77ad7a8bd8"), "name" : "黃金標", "description" : "這秤砣也TM燉熟了", "createDate" : "2021-04-15" }
- { "_id" : ObjectId("6078ebd395708b77ad7a8bd9"), "name" : "賈貴", "description" : "我捂著腦袋捂著臉撅著屁股就跟他打起來了", "createDate" : "2021-04-16" }
- { "_id" : ObjectId("6078ebd395708b77ad7a8bda"), "name" : "黑藤", "description" : "天下漢奸一般蠢", "createDate" : "2021-04-16" }
- { "_id" : ObjectId("6078ebd395708b77ad7a8bdb"), "name" : "孫友福", "description" : "沒有水就沒有魚,沒有你就沒有驢", "createDate" : "2021-04-17" }
嘗試更新所有文檔
- > db.Quotations.update({'name':'賈貴'},{$set: {name: '賈貴',description: '這我哪知道呀!我知道她長的嘿!',createDate: '2021-04-16'}},{multi:true})
- > db.Quotations.find({})
- { "_id" : ObjectId("6078e9743252cc07e092d204"), "name" : "賈貴", "description" : "這我哪知道呀!我知道她長的嘿!", "createDate" : "2021-04-16" }
- { "_id" : ObjectId("6078ebd395708b77ad7a8bd8"), "name" : "黃金標", "description" : "這秤砣也TM燉熟了", "createDate" : "2021-04-15" }
- { "_id" : ObjectId("6078ebd395708b77ad7a8bd9"), "name" : "賈貴", "description" : "這我哪知道呀!我知道她長的嘿!", "createDate" : "2021-04-16" }
- { "_id" : ObjectId("6078ebd395708b77ad7a8bda"), "name" : "黑藤", "description" : "天下漢奸一般蠢", "createDate" : "2021-04-16" }
- { "_id" : ObjectId("6078ebd395708b77ad7a8bdb"), "name" : "孫友福", "description" : "沒有水就沒有魚,沒有你就沒有驢", "createDate" : "2021-04-17" }
這里我們將 multi 參數設置成 True,意味著將更新所有匹配查詢條件的文檔
發(fā)現所有name 為賈貴的語錄都改變了。
不存在則新增
設置 upsert 參數為True, 更新不存在則新增。
- > db.Quotations.update({'name':'瀨川'},{$set:{ 'name' : '瀨川', 'description' : '去東關,搗亂的干活'}},{upsert:true})
- > db.Quotations.find({})
- { "_id" : ObjectId("6078e9743252cc07e092d204"), "name" : "賈貴", "description" : "這我哪知道呀!我知道她長的嘿!", "createDate" : "2021-04-16" }
- { "_id" : ObjectId("6078ebd395708b77ad7a8bd8"), "name" : "黃金標", "description" : "這秤砣也TM燉熟了", "createDate" : "2021-04-15" }
- { "_id" : ObjectId("6078ebd395708b77ad7a8bd9"), "name" : "賈貴", "description" : "這我哪知道呀!我知道她長的嘿!", "createDate" : "2021-04-16" }
- { "_id" : ObjectId("6078ebd395708b77ad7a8bda"), "name" : "黑藤", "description" : "天下漢奸一般蠢", "createDate" : "2021-04-16" }
- { "_id" : ObjectId("6078ebd395708b77ad7a8bdb"), "name" : "孫友福", "description" : "沒有水就沒有魚,沒有你就沒有驢", "createDate" : "2021-04-17" }
- { "_id" : ObjectId("6078ee01249a48b5bb83b936"), "name" : "瀨川", "description" : "去東關,搗亂的干活" }
發(fā)現新增了一條 name 為 瀨川 的文檔記錄
與此同時, 我建議 使用 update_one 方法更新單個文檔, 使用 update_many 方法更新多個文檔。
刪除文檔
刪除匹配查詢條件的所有文檔
- > db.Quotations.remove({'name':'賈貴'})
- WriteResult({ "nRemoved" : 2 })
- > db.Quotations.find({})
- { "_id" : ObjectId("6078ebd395708b77ad7a8bd8"), "name" : "黃金標", "description" : "這秤砣也TM燉熟了", "createDate" : "2021-04-15" }
- { "_id" : ObjectId("6078ebd395708b77ad7a8bda"), "name" : "黑藤", "description" : "天下漢奸一般蠢", "createDate" : "2021-04-16" }
- { "_id" : ObjectId("6078ebd395708b77ad7a8bdb"), "name" : "孫友福", "description" : "沒有水就沒有魚,沒有你就沒有驢", "createDate" : "2021-04-17" }
- { "_id" : ObjectId("6078ee01249a48b5bb83b936"), "name" : "瀨川", "description" : "去東關,搗亂的干活" }
這樣就把 name 為 賈貴的所有文檔記錄全都干掉了。
刪除集合中所有文檔
- > db.Quotations.remove({})
{} 表示無條件,默認移除全部文檔,等價于刪除此集合。
查詢文檔
MongoDB 查詢數據的通用語法
- db.collection.find(query, projection)
條件查詢
指定非 _id 字段 查詢
- > use 地下交通站
- switched to db 地下交通站
- > db.Quotations.find({},{'_id':0})
- { "name" : "黑藤", "description" : "天下漢奸一般蠢", "createDate" : "2021-04-16" }
- { "name" : "孫友福", "description" : "沒有水就沒有魚,沒有你就沒有驢", "createDate" : "2021-04-17" }
- { "name" : "瀨川", "description" : "去東關,搗亂的干活" }
- { "name" : "黃金標", "createDate" : "2021-04-26", "description" : "劉副官你記住了,讓皇軍先尿。" }
- { "name" : "賈貴", "createDate" : "2021-04-18", "description" : "我啐他一臉狗屎" }
- { "name" : "黃金標", "createDate" : "2021-04-26", "description" : "劉副官你記住了,讓皇軍先尿。" }
為了美化輸出,可以使用 pretty() 方法,此方法對 sql 事務不起到任何意義
- db.Quotations.find({},{'_id':0}).pretty()
AND 查詢
查詢 [ name 為 黃金標 ] 并且 [ createDate 為 2021-04-26 ] 的所有文檔記錄
- > db.Quotations.find({"name":"黃金標", "createDate":"2021-04-26"})
- { "_id" : ObjectId("6078f0e31e12a856cf9525da"), "name" : "黃金標", "createDate" : "2021-04-26", "description" : "劉副官你記住了,讓皇軍先尿。" }
- { "_id" : ObjectId("6078f2091e12a856cf9525dd"), "name" : "黃金標", "createDate" : "2021-04-26", "description" : "劉副官你記住了,讓皇軍先尿。" }
OR 查詢
查詢 [ name 為 賈貴 ] 或者 [ description 為 天下漢奸一般蠢 ] 的所有文檔記錄
- > db.Quotations.find({$or:[{"name":"賈貴"},{"description": "天下漢奸一般蠢"}]})
- { "_id" : ObjectId("6078ebd395708b77ad7a8bda"), "name" : "黑藤", "description" : "天下漢奸一般蠢", "createDate" : "2021-04-16" }
- { "_id" : ObjectId("6078f2091e12a856cf9525dc"), "name" : "賈貴", "createDate" : "2021-04-18", "description" : "我啐他一臉狗屎" }
可以看到在這里 OR 查詢使用了顯式操作($or 后接條件列表), OR操作一定是顯式的,不存在隱式的OR操作。
而上面的 AND查詢 操作是不是可以嘗試也寫成 顯式操作
- > db.Quotations.find({$and:[{"name":"黃金標"},{"createDate": "2021-04-26"}]})
- { "_id" : ObjectId("6078f0e31e12a856cf9525da"), "name" : "黃金標", "createDate" : "2021-04-26", "description" : "劉副官你記住了,讓皇軍先尿。" }
- { "_id" : ObjectId("6078f2091e12a856cf9525dd"), "name" : "黃金標", "createDate" : "2021-04-26", "description" : "劉副官你記住了,讓皇軍先尿。" }
發(fā)現也是可以的 !!
AND 和 OR 聯合使用
查詢 [ createDate 為 2021-04-18 ] 并且 [ [ name 為 賈貴 ] 或者 [ description 為 天下漢奸一般蠢 ] ] 的所有文檔記錄
偽sql語句表述為:
- where createDate='2021-04-18' AND (name = '賈貴' OR description = '天下漢奸一般蠢')
- > db.Quotations.find({"createDate": "2021-04-18", $or: [{"name": "賈貴"},{"description": "天下漢奸一般蠢"}]})
- { "_id" : ObjectId("6078f2091e12a856cf9525dc"), "name" : "賈貴", "createDate" : "2021-04-18", "description" : "我啐他一臉狗屎" }
高級查詢
范圍查詢、正則查詢
- $lt 小于
- $gt 大于
- $lte 小于等于
- $gte 大于等于
- $ne 不等于
- $in 在范圍內
- $nin 不在范圍內
查詢創(chuàng)建時間 大于 2021-04-17 的所有文檔記錄
- > db.Quotations.find({"createDate" : {$gt : "2021-04-17"}})
- { "_id" : ObjectId("6078f0e31e12a856cf9525da"), "name" : "黃金標", "createDate" : "2021-04-26", "description" : "劉副官你記住了,讓皇軍先尿。" }
- { "_id" : ObjectId("6078f2091e12a856cf9525dc"), "name" : "賈貴", "createDate" : "2021-04-18", "description" : "我啐他一臉狗屎" }
- { "_id" : ObjectId("6078f2091e12a856cf9525dd"), "name" : "黃金標", "createDate" : "2021-04-26", "description" : "劉副官你記住了,讓皇軍先尿。" }
查詢 [ name 不等于 黃金標 ] 并且 [ createDate 小于 2021-04-26 ] 的所有文檔記錄
- > db.Quotations.find({"name" : {$ne : "黃金標"},"createDate":{$lt : "2021-04-26"}})
- { "_id" : ObjectId("6078ebd395708b77ad7a8bda"), "name" : "黑藤", "description" : "天下漢奸一般蠢", "createDate" : "2021-04-16" }
- { "_id" : ObjectId("6078ebd395708b77ad7a8bdb"), "name" : "孫友福", "description" : "沒有水就沒有魚,沒有你就沒有驢", "createDate" : "2021-04-17" }
- { "_id" : ObjectId("6078f2091e12a856cf9525dc"), "name" : "賈貴", "createDate" : "2021-04-18", "description" : "我啐他一臉狗屎" }
查詢 [ name 包含 黃金標、賈貴 ] 并且 [ createDate 大于 2021-04-02 ] 的所有文檔記錄
- > db.Quotations.find({"name" : {$in : ["黃金標","賈貴"]},"createDate":{$gt : "2021-04-02"}})
- { "_id" : ObjectId("6078f0e31e12a856cf9525da"), "name" : "黃金標", "createDate" : "2021-04-26", "description" : "劉副官你記住了,讓皇軍先尿。" }
- { "_id" : ObjectId("6078f2091e12a856cf9525dc"), "name" : "賈貴", "createDate" : "2021-04-18", "description" : "我啐他一臉狗屎" }
- { "_id" : ObjectId("6078f2091e12a856cf9525dd"), "name" : "黃金標", "createDate" : "2021-04-26", "description" : "劉副官你記住了,讓皇軍先尿。" }
- $regex 匹配正則
- $exists 屬性是否存在
- $type 類型判斷
- $mod 數字模操作
- $text 文本查詢
- $where 高級條件查詢
利用正則語句匹配 name 中帶有 金標 的所有文檔
- > db.Quotations.find({"name":{"$regex":"金標"}})
- { "_id" : ObjectId("6078f0e31e12a856cf9525da"), "name" : "黃金標", "createDate" : "2021-04-26", "description" : "劉副官你記住了,讓皇軍先尿。" }
- { "_id" : ObjectId("6078f2091e12a856cf9525dd"), "name" : "黃金標", "createDate" : "2021-04-26", "description" : "劉副官你記住了,讓皇軍先尿。" }
利用正則語句匹配 以 我 開頭的 description 的所有文檔
- > db.Quotations.find({"description":{"$regex":"^我"}})
- { "_id" : ObjectId("6078f2091e12a856cf9525dc"), "name" : "賈貴", "createDate" : "2021-04-18", "description" : "我啐他一臉狗屎" }
利用正則語句匹配 以 我 開頭、以 屎 結尾 description 的所有文檔
- > db.Quotations.find({"description":{"$regex":"^我.*屎$"}})
- { "_id" : ObjectId("6078f2091e12a856cf9525dc"), "name" : "賈貴", "createDate" : "2021-04-18", "description" : "我啐他一臉狗屎" }
更多高級查詢用法各位讀者請參考 MongoDB 官方文檔
聚合函數
排序
在 MongoDB 中使用 sort() 方法對數據進行排序,sort() 方法可以通過參數指定排序的字段, 并使用 1 和 -1 來指定排序的方式, 其中 1 為升序排列,而 -1 是用于降序排列。
我們總是喜歡用時間維度來排序集合中的文檔
- > db.Quotations.find({},{"_id":0}).sort({"createDate":-1})
- { "name" : "黃金標", "createDate" : "2021-04-26", "description" : "劉副官你記住了,讓皇軍先尿。" }
- { "name" : "黃金標", "createDate" : "2021-04-26", "description" : "劉副官你記住了,讓皇軍先尿。" }
- { "name" : "賈貴", "createDate" : "2021-04-18", "description" : "我啐他一臉狗屎" }
- { "name" : "孫友福", "description" : "沒有水就沒有魚,沒有你就沒有驢", "createDate" : "2021-04-17" }
- { "name" : "黑藤", "description" : "天下漢奸一般蠢", "createDate" : "2021-04-16" }
- { "name" : "瀨川", "description" : "去東關,搗亂的干活" }
分組
- db.Quotations.aggregate({$group:{_id:{name:"$name"}}})
根據 name 和 description 字段進行分組
- db.Quotations.aggregate({
- $group:{
- _id:{name:"$name",description:"$description"}
- }})
由于我們現有集合文檔的字段中并沒有可計算的數值
我們嘗試添加一個集合字段并先賦值為空
- db.Quotations.update({},{$set:{"forceValue": ""}},{multi:true})
添加隨機值
- db.Quotations.update({"name":"黑藤"},{$set:{"forceValue": Math.random()*100}},{multi:true})
- db.Quotations.update({"name":"孫友福"},{$set:{"forceValue": Math.random()*100}},{multi:true})
- db.Quotations.update({"name":"瀨川"},{$set:{"forceValue": Math.random()*100}},{multi:true})
- db.Quotations.update({"name":"黃金標"},{$set:{"forceValue": Math.random()*100}},{multi:true})
- db.Quotations.update({"name":"賈貴"},{$set:{"forceValue": Math.random()*100}},{multi:true})
結果如下
- { "name" : "黑藤", "description" : "天下漢奸一般蠢", "createDate" : "2021-04-16", "forceValue" : 14.796604243632927 }
- { "name" : "孫友福", "description" : "沒有水就沒有魚,沒有你就沒有驢", "createDate" : "2021-04-17", "forceValue" : 43.71427504449847 }
- { "name" : "瀨川", "description" : "去東關,搗亂的干活", "forceValue" : 41.53502198761502 }
- { "name" : "黃金標", "createDate" : "2021-04-26", "description" : "劉副官你記住了,讓皇軍先尿。", "forceValue" : 21.887495918176125 }
- { "name" : "賈貴", "createDate" : "2021-04-18", "description" : "我啐他一臉狗屎", "forceValue" : 94.18697675337746 }
由于要用到分組,我們需要多添加幾條文檔數據
- db.Quotations.insertMany([
- {name: '黃金標',description: '我黃某人為官一任就得保一方平安',forceValue:Math.random()*100,createDate: '2021-04-11'},
- {name: '賈貴',description: '皇軍沒來的時候,你欺負我,皇軍來了你還欺負我,那皇軍不是TM白來了嗎',forceValue:Math.random()*100,createDate: '2021-04-14'},
- {name: '黑藤',description: '全東亞乃至全亞洲都找不到第二張想你這么一張空前絕后的臉來',forceValue:Math.random()*100,createDate: '2021-04-22'},
- {name: '賈貴',description: '這我哪知道啊,我就知道她長得嘿',forceValue:Math.random()*100, createDate: '2021-04-19'}
- ])
分組使用聚合函數
常用聚合函數
- $sum
- $avg
- $max
- $min
- $first
- $last
根據 name 分組并使用 $sum 函數求和,得到一下結果
- $match 查詢條件
- $group 根據字段分組(可以是多字段) + 聚合函數
- > db.Quotations.aggregate(
- ... {"$match":{"createDate":{"$gt":"2021-04-07"}}},
- ... {"$group":{"_id":"$name",'forceValue':{"$sum":"$forceValue"}}},
- ... )
- { "_id" : "賈貴", "forceValue" : 204.22774268609504 }
- { "_id" : "黃金標", "forceValue" : 121.14812944012357 }
- { "_id" : "黑藤", "forceValue" : 91.2583132098972 }
- { "_id" : "孫友福", "forceValue" : 43.71427504449847 }
這相當于在 Mysql 中執(zhí)行
- select id,sum(forceValue) from Quotations where createDate > "2021-04-07" group by name;
$avg 求平均
- > db.Quotations.aggregate(
- ... {"$match":{"createDate":{"$gt":"2021-04-07"}}},
- ... {"$group":{"_id":"$name",'forceValue':{"$avg":"$forceValue"}}},
- ... )
- { "_id" : "賈貴", "forceValue" : 68.07591422869835 }
- { "_id" : "黃金標", "forceValue" : 60.574064720061784 }
- { "_id" : "黑藤", "forceValue" : 45.6291566049486 }
- { "_id" : "孫友福", "forceValue" : 43.71427504449847 }
多字段分組
根據 createDate + name 進行分組之后求和
- > db.Quotations.aggregate(
- ... ... {"$match":{"createDate":{"$gt":"2021-04-07"}}},
- ... ... {"$group":{"_id":{"createDate":"$createDate","name":"$name"},'forceValue':{"$sum":"$forceValue"}}},
- ... ... )
- { "_id" : { "createDate" : "2021-04-11", "name" : "黃金標" }, "forceValue" : 99.26063352194744 }
- { "_id" : { "createDate" : "2021-04-16", "name" : "黑藤" }, "forceValue" : 14.796604243632927 }
- { "_id" : { "createDate" : "2021-04-17", "name" : "孫友福" }, "forceValue" : 43.71427504449847 }
- { "_id" : { "createDate" : "2021-04-18", "name" : "賈貴" }, "forceValue" : 94.18697675337746 }
- { "_id" : { "createDate" : "2021-04-26", "name" : "黃金標" }, "forceValue" : 21.887495918176125 }
- { "_id" : { "createDate" : "2021-04-14", "name" : "賈貴" }, "forceValue" : 81.9931941785778 }
- { "_id" : { "createDate" : "2021-04-22", "name" : "黑藤" }, "forceValue" : 76.46170896626427 }
- { "_id" : { "createDate" : "2021-04-19", "name" : "賈貴" }, "forceValue" : 28.04757175413979 }
我不能再繼續(xù)寫下去了,MongoDB 的基礎入門就介紹到這里
更多教程請參考 MongoDB官方文檔
結束語
我是吳老板,以上就是我們這次的干貨分享了。最后重申下:
MongoDB 是非關系型數據庫的代表,一款基于鍵值儲存的高性能數據庫。常作為爬蟲儲存數據庫。
MongoDB 是一個基于分布式文件存儲的數據庫。由 C++ 語言編寫。旨在為 WEB 應用提供可擴展的高性能數據存儲解決方案。
MongoDB 是一個介于關系數據庫和非關系數據庫之間的產品,是非關系數據庫當中功能最豐富,最像關系數據庫的。
新聞名稱:一文帶你搞懂爬蟲儲存數據庫MongoDB
鏈接分享:http://m.5511xx.com/article/dhccccc.html


咨詢
建站咨詢
