2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Mac OS XにmongoDBをインストール

Last updated at Posted at 2017-08-04

#構成
MacBook Air (11-inch, Mid 2013)
プロセッサ 1.3 GHz Intel Core i5
メモリ 4 GB 1600 MHz DDR3
macOS Sierra 10.12.5
#brewをインストール
brewが使えない人は公式サイトにアクセスして、コマンドを実行
使える人は飛ばしてください。

//raw.githubusercontent.com/Homebrew/install/master/install)"

#mongoDBをインストール
homebrewを使って、mongoDBをインストール

brew update
brew install mongodb

#mongoDBの確認
mongoDBを起動

mongo

データベースを使う

//データベースを選択
use test_database
//データを保存する
db.test_collection.insert({"name":"yamada","age":20})
//データを取得する
db.test_collection.find()

こんな結果が帰って来ればOK

{ "_id" : ObjectId("59847cc01516e38618ab3a1b"), "name" : "yamada", "age" : 20 }
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?