zoukankan      html  css  js  c++  java
  • MongoDB (3) MongoDB shell

    1、连接数据库命令

      连接本地数据库:

       未设密码时:命令“mongo”即进入本地数据库 localhost:27017

       

      连接远程数据库:

    2、基本命令:

      show dbs;查看所有数据库

      use testdb;使用testdb数据库

      show collections:查看所有集合(即表)

      db.user.find();查看整表;

    3、MongoDB CRUD Operations

      CRUD operations createreadupdate, and delete documents.

      增加(Create)、读取查询(Retrieve)、更新(Update)和删除(Delete)

      C reate new records

      R etrieve existing records

      U pdate existing records
      D elete existing records.
      

     Create Operations

      创建

      Create or insert operations add new documents to a collection. If the collection does not currently exist, insert operations will create the collection.

      create或者insert动作是插入一条新数据到一个集合中,如果当前集合不存在,insert动作会创建一个新的集合。

      MongoDB provides the following methods to insert documents into a collection:

      MongoDB支持下面的方法向集合中插入数据

        db.collection.insertOne() New in version 3.2

        db.collection.insertMany() New in version 3.2

    to be continue.....

      
      
  • 相关阅读:
    nginx--gunicorn 部署Web服务
    Hexo 搭建博客真的太简单了
    nohup 和 &
    Nginx 服务器搭建
    Django3 的服务器搭建
    Mongo 服务器的安装
    Ubuntu16.04 安装tesseract
    phantomjs 的安装
    JsonPath python
    CSS 选择器:BeautifulSoup4
  • 原文地址:https://www.cnblogs.com/kplsm123/p/7192350.html
Copyright © 2011-2022 走看看