[MongoDB] Serveral common command of MongoDb, mongodbserveral

Source: Internet
Author: User
Tags mongodb client mongodb server

[MongoDB] Serveral common command of MongoDb, mongodbserveral

In the recent days, since the overwork made me exhaused, on arrival to home I will go to bed, which leads to loss of blogs that shoshould have been written in the past days.

Now I make a summay to all the commond of operating mongoDB.

First, you shoshould run the mongoDB server. if the following picture exists, it means you has run the mongoDB successfully.


Secondly, after run the mongodb server, next shoshould execute the mongodb client.


Thirdly, we input the db. help command, we will find all the method to operate database/


In the above picture, it; s generally used in the development.

Notes, in the mongodb, there is no command like mysql ('create database XXX'), instead use command 'use dbname' to create a new db;

Lastly I set a simple exampe to show usage of some command.







An error 1067 is reported when mongodb starts the service. The process is terminated unexpectedly.

I have encountered a similar problem before. My personal analysis is a data problem. I checked the information on the Internet and said I would delete mongod. the lock file can be restarted, but the above problem still occurs on my machine.
If you have been doing well before, just because the data is inserted and the service cannot be used, the solution to the problem is very simple, and the data you just copied and mongod. delete lock files (all in the data folder ). It may be because a folder in the mongodb-win32-i386-2.2.1 version has the data you just copied in, and data duplication causes only deleting mongod. lock to fail to start.
Note: When mongodb is in the mongodb-win32-i386-2.2.1 version, the data stored in the data folder will create its own folder (previously saved directly in. ns. 0. 1 format under the data folder ).
This is my own method. I cannot analyze the specific cause. I hope this will help you.

Mongodb cannot be started, and cannot be connected because the target computer is actively rejected.

This is not because mongodb cannot be started. If you haven't started mongodb, you can connect to it and use it. It is definitely not successful.
Run mongod -- dbpath XXXX/data in the bin directory of mongodb to start mongodb, and then connect to mongodb.

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.