Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mongdb installation and use

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. Download address: https://www.mongodb.com/dr/fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-3.2.7-signed.msi/download

2. Install it after the download is completed.

3, configuration

By default, mongdb is installed in C:\ Program Files\ MongoDB\ Server\ 3.2\ bin. Find the Bin directory of the installation path.

Open the cmd window

If the above information is displayed, you can be sure that the database configuration was successful. Open a browser and enter: http://localhost:27017/

4, use the mongdb server as the window server

Mongod.exe-logpath "C:\ mongdb\ log\ mongodb.log"-logappend-dbpath "C:\ mongdb\ db"-install

Please note that you must have administrative privileges to run the following command. Execute the following command to run the MongoDB server as a Windows service:

Mongod.exe--bind_ip yourIPadress-logpath "C:\ data\ dbConf\ mongodb.log"-logappend-dbpath "C:\ data\ db"-port yourPortNumber-- serviceName "YourServiceName"-serviceDisplayName "YourServiceName"-install

The following table shows the parameters of mongodb startup:

5. Log in to the backend

If you need to enter the MongoDB background management, you need to first open the bin directory under the mongodb installation directory, and then execute the mongo.exe file. MongoDB Shell is the interactive Javascript shell that comes with MongoDB, which is used to operate and manage MongoDB.

When you enter the mongoDB background, it will link to the test document (database) by default:

Open C:\ Program Files\ MongoDB\ Server\ 3.2\ bin\ mongo.exe, which will connect to test by default

A, view the database

2016-06-13T15:48:13.442+0800 I CONTROL [main] Hotfix KB2731284 or later update

Is not installed, will zero-out data files

MongoDB shell version: 3.2.7

Connecting to: test

> db

Test

B, save the data

> db.aa.save ({aVl1})

WriiteResult ({"nInserted": 1})

C, find the data

> db.aa.find ()

{"_ id": ObjectId ("575e729f57c87be720a9134f"), "a": 1}

D, modify the data

> db.aa.update ({aVl1}, {aVl2})

WriteResult ({"nMatched": 1, "nUpserted": 0, "nModified": 1})

E, delete data

> db.aa.remove ({aVER2})

WriteResult ({"nRemoved": 1})

>

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report