MongoDB 数据库日常查询等操作汇总

MongoDB 数据库日常查询等操作汇总

1.创建数据库及固定集合大小:
use database
db.createCollection(“user2”,{capped:true,size:524288000})

2.自动安装MongoDB bat命令:


@echo off 
echo "Stop the MongoDB Server..."
net stop MongoDB
echo "start the MongoDB Server..."
net start MongoDB
echo "Connect the MongoDB..."
MongoDB
echo "Create Database DBMDC..."
use DBMDC
echo "Create Collection MDC_DATA and capped..."
db.createCollection("MDC_DATA",{capped:true,size:524288000})
pause

你可能感兴趣的:(MongoDB)