on Debian 基本使用

使用預設路徑(/etc/mong.conf)

/var/lib/mongodb

service mongod start

進入 REPL (Read-Evai-Print-Loop)互動命令列

mongo
>

顯示資料庫

>show dbs
> db
test #預設資料庫物件
> use mydatabase #使用mydatabase,沒有會自動建立
switched to db mydatabase
> db
mydatabase

插入一列資料,會自動建立資料表(集合) :class100,插入JSON檔案

顯示資料表

顯示JSON資料

找出需要的資料

Last updated

Was this helpful?