Home > Database > Mysql Tutorial > mongodb 数据库创建和删除

mongodb 数据库创建和删除

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 15:11:58
Original
1010 people have browsed it

MongoDB创建数据库可以使用use指令: 如下: use mydb; 这样就创建了一个数据库。 这一步很重要如果什么都不操作离开的话 这个库就会被系统删除。 验证------------------------------- 然后使用插入语句: db.user.insert({name:'zhouzhigang'}); 在使用下列

MongoDB创建数据库可以使用use指令:

如下:

use mydb;

这样就创建了一个数据库。

这一步很重要如果什么都不操作离开的话 这个库就会被系统删除。

 

验证-------------------------------

然后使用插入语句:

db.user.insert({name:'zhouzhigang'});

在使用下列命令查看

show collections;      ---查看‘表’ 

show dbs                   ---查看库

如图操作:

mongodb 数据库创建和删除

mongodb 删除数据库

use mydb; 

 db.dropDatabase();


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
Latest Issues
mongodb start
From 1970-01-01 08:00:00
0
0
0
linux - ubuntu14 error installing mongodb
From 1970-01-01 08:00:00
0
0
0
Use of symfony2 mongodb
From 1970-01-01 08:00:00
0
0
0
mongodb _id rename
From 1970-01-01 08:00:00
0
0
0
Parameter understanding of mongodb
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template