MongoDB Getting Started knowledge

Source: Internet
Author: User
Tags mongodb server

Basic concepts

MongoDB is a document-oriented database, not a relational database. MongoDB is modeless, meaning that the document's keys do not need to be defined in advance, nor are they immutable.

There are some new definitions in MongoDB compared to relational databases:

  • document : equivalent to a row in a relational database, is the basic data unit of MongoDB. A document is an orderly combination of a set of key/value pairs.
    • The key/value pairs in the document are ordered, meaning {"name": "Wilber", "Age": 27} and {"Age": "Name": "Wilber"} is a different document
    • The value of a document is type-sensitive, and the document is case-sensitive.

      {"Name": "Wilber", "Age": 27} differs from {"Name": "Wilber", "Age": "27"}

    • Another point to note is that there are no duplicate keys allowed in MongoDB's documentation.

      Illegal document, {"name": "Wilber", "name": "Would"}

  • Collection : A collection is a combination of a set of documents, equivalent to a table in a relational database, but a modeless table.

    The document {"name": "Wilber", "Age": 27} and {"name": "Will"} can be stored in the same collection.

  • database : is a combination of a set of collections. A MongoDB instance can manage multiple databases, each of which corresponds to a different disk file, so each database has independent permissions control.
Basic Operation MongoDB Server-side startup:

My MongoDB loads the C drive, which is started by the following way. The storage directory of DB is established by the-dbpath parameter. You can see more options through Mongod.exe–help.

Information that can be obtained:

    • DB version is v2.6.5
    • MongoDB Server uses 27017 port

Mongod also initiates an HTTP server that listens to ports 1000 higher than the server. That is, the management information of the database can be obtained through http://localhost:28017/.

MongoDB Shell:

MongoDB comes with a JavaScript shell that can manipulate the MongoDB database from the command line.

Start the MongoDB shell, and through the help command, you can list the shell commands

Summarize

Through the above introduction, you can have a preliminary understanding of MongoDB, the next will start the document additions and deletions to change the operation.

MongoDB Getting Started knowledge

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.