• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
LilyLiya
博客园    首页    新随笔    联系   管理    订阅  订阅
Mongo DB-0
下载安装,基础查看新建操作

 

前言:

  • what is MONGO?

It is commonly used in combination with Node. Mongo is a document database, which we can use to store and retrive complex data from.

  • Why use a database instead of just saving to a file
  1. Databases can handle large amount of data efficiently and store it compactly
  2. They provide tools for easy insertion, querying, and updating of data
  3. They generally offer security features and control over access to data
  4. They (generally) scale well
  • SQL VS NOSQL
    • SQL DATABASES: Structured Query Language databases are relational databases. We pre-define a schema of tables before we insert anything.
    • NO-SQL DATAVASES: NoSQL databases do not use SQL. There are many types of no-sql database, including documents, key-value, and graph stores.
  • Popular Databases

  • why are we learning MANGO?
  1. Mongo is very commonly used with Node and Express(MEAN&MERN stacks)
  2. it's easy to get started with(through it can be tricky to truly master)
  3. It plays particularly well with JavaScript
  4. Its popularity also means there is a strong community of developers using Mongo.

 

  • MongoDB下载安装步骤 : https://docs.mongodb.com/manual/installation/ 
  1. 在官网https://brew.sh/#install install Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

2. brew tap mongodb/brew

3. brew install mongodb-community@4.4

4. brew services start mongodb-community@4.4

1,2,3,4都在terminal运行下载安装(MacOS)

  • 在terminal输入mongo进入服务
  • 输入help查看用法
  • show dbs/ show collections/use <db_name>(如果db_name不是已经存在的话,新建一个)/db.dogs.find()

 

posted on 2021-02-09 05:41  LilyLiya  阅读(38)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3