Table of Contents
1. 简介
2. 文档document
3. 集合
4. 数据库database
4.1 admin
4.2 local
4.3 config
Home Database Mysql Tutorial Mongodb简介

Mongodb简介

Jun 07, 2016 pm 03:56 PM
mongodb powerful flexible Introduction

1. 简介 Mongodb是一种强大,灵活,可扩展的数据存储方式,属于nosql,非关系型数据库的一种。 mongodb是面向文档的数据库。虽然是非关系型数据库,但是它保留了许多关系型数据库的特性:索引,范围查询,排序等。 mongodb容易上手,便于使用,并且安装配置

1. 简介

Mongodb是一种强大,灵活,可扩展的数据存储方式,属于nosql,非关系型数据库的一种。 mongodb是面向文档的数据库。虽然是非关系型数据库,但是它保留了许多关系型数据库的特性:索引,范围查询,排序等。 mongodb容易上手,便于使用,并且安装配置都比较简单。

2. 文档document

文档(document)是mongodb的基本单元,类似于mysql中的行(row)。文档是json格式,key/value对。
{"greeting" : "Hello, world!"}
Copy after login
存储的内容区分类型,大小写,并且不能有重复的key。
key的命名规则:不能有\0(空字符),这个字符表示key的结尾; .和$ ,为保留字符,不建议使用;不要以下划线_开头;

3. 集合

集合为一组文档,类似于mysql的表。集合是无模式的,意思是一个集合中的文档可以是多种多样的,文档的类型,key,都可以不同。不像mysql中那样每一条记录必须有多少列,以及相同的列。
在正式使用中,一个集合最好划分相同的模式。 相同模式的数据,开发者程序查询等处理时,方便处理。一个集合中查询特定类型速度上不划算,分开多个集合查询要快很多。同种类型文档在一个集合,数据更集中。同种类型文档在一个集合,索引更有效。

4. 数据库database

多个集合组成一个数据库,一个mongodb实例中可以有多个数据库。每个数据库权限控制和在磁盘保存文件上都是独立的。
命名规则:不能是空字符串,不能包含空格,. $ / \ \0, 应全部小写, 最多64字节,
特殊自带数据库:

4.1 admin

保存用户以及权限信息。列出所有数据库,关闭数据库,必须在admin下面。

4.2 local

这个数据库不会被复制。用于存储本地服务器的集合。

4.3 config

mongodb分片时,保存分片信息。
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to connect navicat to mongodb How to connect navicat to mongodb Apr 24, 2024 am 11:27 AM

To connect to MongoDB using Navicat, you need to: Install Navicat Create a MongoDB connection: a. Enter the connection name, host address and port b. Enter the authentication information (if required) Add an SSL certificate (if required) Verify the connection Save the connection

What is the use of net4.0 What is the use of net4.0 May 10, 2024 am 01:09 AM

.NET 4.0 is used to create a variety of applications and it provides application developers with rich features including: object-oriented programming, flexibility, powerful architecture, cloud computing integration, performance optimization, extensive libraries, security, Scalability, data access, and mobile development support.

Integration of Java functions and databases in serverless architecture Integration of Java functions and databases in serverless architecture Apr 28, 2024 am 08:57 AM

In a serverless architecture, Java functions can be integrated with the database to access and manipulate data in the database. Key steps include: creating Java functions, configuring environment variables, deploying functions, and testing functions. By following these steps, developers can build complex applications that seamlessly access data stored in databases.

How to configure MongoDB automatic expansion on Debian How to configure MongoDB automatic expansion on Debian Apr 02, 2025 am 07:36 AM

This article introduces how to configure MongoDB on Debian system to achieve automatic expansion. The main steps include setting up the MongoDB replica set and disk space monitoring. 1. MongoDB installation First, make sure that MongoDB is installed on the Debian system. Install using the following command: sudoaptupdatesudoaptinstall-ymongodb-org 2. Configuring MongoDB replica set MongoDB replica set ensures high availability and data redundancy, which is the basis for achieving automatic capacity expansion. Start MongoDB service: sudosystemctlstartmongodsudosys

How to ensure high availability of MongoDB on Debian How to ensure high availability of MongoDB on Debian Apr 02, 2025 am 07:21 AM

This article describes how to build a highly available MongoDB database on a Debian system. We will explore multiple ways to ensure data security and services continue to operate. Key strategy: ReplicaSet: ReplicaSet: Use replicasets to achieve data redundancy and automatic failover. When a master node fails, the replica set will automatically elect a new master node to ensure the continuous availability of the service. Data backup and recovery: Regularly use the mongodump command to backup the database and formulate effective recovery strategies to deal with the risk of data loss. Monitoring and Alarms: Deploy monitoring tools (such as Prometheus, Grafana) to monitor the running status of MongoDB in real time, and

Navicat's method to view MongoDB database password Navicat's method to view MongoDB database password Apr 08, 2025 pm 09:39 PM

It is impossible to view MongoDB password directly through Navicat because it is stored as hash values. How to retrieve lost passwords: 1. Reset passwords; 2. Check configuration files (may contain hash values); 3. Check codes (may hardcode passwords).

Major update of Pi Coin: Pi Bank is coming! Major update of Pi Coin: Pi Bank is coming! Mar 03, 2025 pm 06:18 PM

PiNetwork is about to launch PiBank, a revolutionary mobile banking platform! PiNetwork today released a major update on Elmahrosa (Face) PIMISRBank, referred to as PiBank, which perfectly integrates traditional banking services with PiNetwork cryptocurrency functions to realize the atomic exchange of fiat currencies and cryptocurrencies (supports the swap between fiat currencies such as the US dollar, euro, and Indonesian rupiah with cryptocurrencies such as PiCoin, USDT, and USDC). What is the charm of PiBank? Let's find out! PiBank's main functions: One-stop management of bank accounts and cryptocurrency assets. Support real-time transactions and adopt biospecies

How to open table connection in navicat How to open table connection in navicat Apr 24, 2024 am 09:39 AM

Steps to access table connections through Navicat: 1. Connect to the database; 2. Browse to the required database; 3. Right-click the table and select "Edit Table"; 4. View the table data.

See all articles