MongoDB The Definitive Guide讀書筆記

紀錄讀MongoDB: The Definitive Guide這本書時,自己認為的重點

DataBase名稱可以用任何 UTF-8 字串,並且符合以下規則

  • 空字串不是有效名稱
  • 不能包含/, \, ., “, *, <, >, :, |, ?, $, (a single space), or \0 (the null character)
  • 名稱有區分大小寫,即使在不分大小寫的檔案系統裡
  • 最大限制 64 bytes

預先留存的DataBase,含有特殊的含義

  • admin : 代表root DataBase,如果一個user被加入此DB,該user自動繼承允許連到其他DB
  • local : 這個DB永遠不會被replicated,慣用於儲存any collections that should be local to a single server
  • config : 用來sharded setup,儲存shard的資訊

mongod預設儲存的資料路徑 /data/db/

預設的port=27017

可以用 —httpinterface 這個參數設定一個簡單的http interface 他的port指定為主要port多1000。以預設port為例,可以連到http://localhost:28017觀看