zoukankan      html  css  js  c++  java
  • 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.
    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()
  • 相关阅读:
    记一次给自己的本子更换一个SSD盘
    喜欢的电影
    一个人没有出息的9大根源
    经典思维模式
    Linux基础入门教程
    XML
    UML
    Linux最常用的基础命令
    IP地址
    http协议
  • 原文地址:https://www.cnblogs.com/LilyLiya/p/14391731.html
Copyright © 2011-2022 走看看