using mongodb command
2013-06-03 00:00
197 查看
文章来自我的博客:https://www.lwxshow.com/db/mongo/using-mongodb-command.html
mongodb常用命令
show dbs; #显示数据库
> show tables;#显示表
> show collections;#显示表
在cuser表/集合中插入一条数据.
> db
test
> db.cuser.insert({name:"ava",pwd:"yesido"});
#查找数据
db.cuser.find();
#更新 将条件为 name =ava的 列 全部替换为 name:haha
db.cuser.update({name:"ava"},{name:"haha"});
#更新 将条件为 name =ava的 列 更改为 name:haha
db.cuser.update({name:"ava"},{$set:{name:"haha"}});
#更新 将条件为 name =ava的 列 更改为 name:haha,并添加一条sex:nan
db.cuser.update({name:"ava"},{$set:{name:"haha",sex:"nan"}});
#删除 表数据
db.cuser.remove();
mongodb常用命令
show dbs; #显示数据库> show tables;#显示表
> show collections;#显示表
在cuser表/集合中插入一条数据.
> db
test
> db.cuser.insert({name:"ava",pwd:"yesido"});
#查找数据
db.cuser.find();
#更新 将条件为 name =ava的 列 全部替换为 name:haha
db.cuser.update({name:"ava"},{name:"haha"});
#更新 将条件为 name =ava的 列 更改为 name:haha
db.cuser.update({name:"ava"},{$set:{name:"haha"}});
#更新 将条件为 name =ava的 列 更改为 name:haha,并添加一条sex:nan
db.cuser.update({name:"ava"},{$set:{name:"haha",sex:"nan"}});
#删除 表数据
db.cuser.remove();
相关文章推荐
- using mongodb advanced command 3
- using mongodb advanced command 2
- using mongodb advanced command 1
- Start OpenOffice.org using the command line
- HowTo: Flush Contents Of a Memcached Server Using Command Line
- USING THE NETWORKMANAGER COMMAND LINE TOOL, NMCLI
- Could not execute auto check for display colors using command
- Section 2: Console Tab : Using Commandline API in Firebug
- [Yii Framework] Using createCommand() cause query problem
- Insert Data Using SqlCommandBuilder
- [转]a-mongodb-tutorial-using-c-and-asp-net-mvc
- Using the ps command
- mysqldump Warning: Using a password on the command line interface can be insecure.
- IT忍者神龟之RHEL / Centos 6: Install Nginx Using Yum Command 翻译
- 4.2.3.1. Using Options on the Command Line
- run command from Java driver for MongoDB
- Mongodb源码分析--Command体系架构
- MySQL5.6 Using a password on the command line inte
- How do I drop a MongoDB database, from the command line?
- Custom my command using shell.