- 浏览: 836162 次
- 性别:
- 来自: 北京、四川
-
文章分类
最新评论
-
sunbeamzheng:
总结的很好,好好看看。 拷贝问题确实很需要注意,特别是影不影响 ...
java深拷贝与浅拷贝 -
xmh8023:
...
获取POST数据的值 -
xmh8023:
我访问别的服务器怎么办?急求
获取POST数据的值 -
xmh8023:
String urlString="http://l ...
获取POST数据的值 -
lv12312:
Tomcat 7的老版本么?有bug的,https://iss ...
JMX问题
首先在mongo官网下载Windows的版本
启动服务:mongod.exe --port 12345 --dbpath=c:\mongodb\db
显示一下信息:
Fri Dec 04 14:30:32 Mongo DB : starting : pid = 0 port = 12345 dbpath = c:\mongo
db\db master = 0 slave = 0 32-bit
** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data
** see http://blog.mongodb.org/post/137788967/32-bit-limitations for more
Fri Dec 04 14:30:32 db version v1.1.4-, pdfile version 4.5
Fri Dec 04 14:30:32 git version: c67c2f7dd681152f1784c8e1c2119b979e65881d
Fri Dec 04 14:30:32 sys info: windows (5, 1, 2600, 2, 'Service Pack 3') BOOST_LI
B_VERSION=1_35
Fri Dec 04 14:30:32 waiting for connections on port 12345
启动客户端:mongo.exe localhost:12345
检查是否正常:db.foo.save({a:1,b:9})
db.foo.find({a:1})
控制台显示:{ "_id" : ObjectId("4b18b5b56f40000000006cec"), "a" : 1, "b" : 9 }
添加数据:db.foo.save({a:1,b:9})
查询数据:db.foo.find({a:1}) //{a:1}是查询条件,当为空时查询所有
db.foo.findOne({a:1}) //显示出一条数据
删除数据:db.foo.remove({a:1}) //删除a=1的数据
表的数据量:db.foo.find().count()
显示数据指定的条数:db.foo.find().limit(n)
显示库名:db.foo.getDB()
获取索引值:db.foo.getIndexes()
表的统计:db.foo.stats()
删除表:db.foo.drop()
获取不重复的列:db.foo.distinct( key ) - eg. db.foo.distinct( 'x' )
忽略前面的几行:db.other.find({a:2}).skip(2)//忽略a=2中的前面2行
方法帮助:db.foo.help()
HELP
show dbs show database names
show collections show collections in current database
show users show users in current database
show profile show most recent system.profile entries with time >= 1ms
use <db name> set curent database to <db name>
db.help() help on DB methods
db.foo.help() help on collection methods
db.foo.find() list objects in collection foo
db.foo.find( { a : 1 } ) list objects in foo where a == 1
it result of the last line evaluated; use to further iterate
DB methods:
db.addUser(username, password)
db.auth(username, password)
db.cloneDatabase(fromhost)
db.commandHelp(name) returns the help for the command
db.copyDatabase(fromdb, todb, fromhost)
db.createCollection(name, { size : ..., capped : ..., max : ... } )
db.currentOp() displays the current operation in the db
db.dropDatabase()
db.eval(func, args) run code server-side
db.getCollection(cname) same as db['cname'] or db.cname
db.getCollectionNames()
db.getLastError() - just returns the err msg string
db.getLastErrorObj() - return full status object
db.getMongo() get the server connection object
db.getMongo().setSlaveOk() allow this connection to read from the nonmaster member of a replica pair
db.getName()
db.getPrevError()
db.getProfilingLevel()
db.getReplicationInfo()
db.getSisterDB(name) get the db at the same server as this onew
db.killOp() kills the current operation in the db
db.printCollectionStats()
db.printReplicationInfo()
db.printSlaveReplicationInfo()
db.printShardingStatus()
db.removeUser(username)
db.repairDatabase()
db.resetError()
db.runCommand(cmdObj) run a database command. if cmdObj is a string, turns it into { cmdObj : 1 }
db.setProfilingLevel(level) 0=off 1=slow 2=all
db.shutdownServer()
db.version() current version of the server
DBCollection help
db.foo.count()
db.foo.dataSize()
db.foo.distinct( key ) - eg. db.foo.distinct( 'x' )
db.foo.drop() drop the collection
db.foo.dropIndex(name)
db.foo.dropIndexes()
db.foo.ensureIndex(keypattern,options) - options should be an object with these possible fields: name, unique, dropDups
db.foo.find( [query] , [fields]) - first parameter is an optional queryfilter. second parameter is optional set of fields to return. e.g. db.foo.find( { x : 77 } , { name : 1 , x : 1 } )
db.foo.find(...).count()
db.foo.find(...).limit(n)
db.foo.find(...).skip(n)
db.foo.find(...).sort(...)
db.foo.findOne([query])
db.foo.getDB() get DB object associated with collection
db.foo.getIndexes()
db.foo.group( { key : ..., initial: ..., reduce : ...[, cond: ...] } )
db.foo.mapReduce( mapFunction , reduceFunction , <optional params> )
db.foo.remove(query)
db.foo.renameCollection( newName ) renames the collection
db.foo.save(obj)
db.foo.stats()
db.foo.storageSize() - includes free space allocated to this collection
db.foo.totalIndexSize() - size in bytes of all the indexes
db.foo.totalSize() - storage allocated for all data and indexes
db.foo.update(query, object[, upsert_bool])
db.foo.validate() - SLOW
db.foo.getShardVersion() - only for use with sharding
启动服务:mongod.exe --port 12345 --dbpath=c:\mongodb\db
显示一下信息:
Fri Dec 04 14:30:32 Mongo DB : starting : pid = 0 port = 12345 dbpath = c:\mongo
db\db master = 0 slave = 0 32-bit
** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data
** see http://blog.mongodb.org/post/137788967/32-bit-limitations for more
Fri Dec 04 14:30:32 db version v1.1.4-, pdfile version 4.5
Fri Dec 04 14:30:32 git version: c67c2f7dd681152f1784c8e1c2119b979e65881d
Fri Dec 04 14:30:32 sys info: windows (5, 1, 2600, 2, 'Service Pack 3') BOOST_LI
B_VERSION=1_35
Fri Dec 04 14:30:32 waiting for connections on port 12345
启动客户端:mongo.exe localhost:12345
检查是否正常:db.foo.save({a:1,b:9})
db.foo.find({a:1})
控制台显示:{ "_id" : ObjectId("4b18b5b56f40000000006cec"), "a" : 1, "b" : 9 }
添加数据:db.foo.save({a:1,b:9})
查询数据:db.foo.find({a:1}) //{a:1}是查询条件,当为空时查询所有
db.foo.findOne({a:1}) //显示出一条数据
删除数据:db.foo.remove({a:1}) //删除a=1的数据
表的数据量:db.foo.find().count()
显示数据指定的条数:db.foo.find().limit(n)
显示库名:db.foo.getDB()
获取索引值:db.foo.getIndexes()
表的统计:db.foo.stats()
删除表:db.foo.drop()
获取不重复的列:db.foo.distinct( key ) - eg. db.foo.distinct( 'x' )
忽略前面的几行:db.other.find({a:2}).skip(2)//忽略a=2中的前面2行
方法帮助:db.foo.help()
HELP
show dbs show database names
show collections show collections in current database
show users show users in current database
show profile show most recent system.profile entries with time >= 1ms
use <db name> set curent database to <db name>
db.help() help on DB methods
db.foo.help() help on collection methods
db.foo.find() list objects in collection foo
db.foo.find( { a : 1 } ) list objects in foo where a == 1
it result of the last line evaluated; use to further iterate
DB methods:
db.addUser(username, password)
db.auth(username, password)
db.cloneDatabase(fromhost)
db.commandHelp(name) returns the help for the command
db.copyDatabase(fromdb, todb, fromhost)
db.createCollection(name, { size : ..., capped : ..., max : ... } )
db.currentOp() displays the current operation in the db
db.dropDatabase()
db.eval(func, args) run code server-side
db.getCollection(cname) same as db['cname'] or db.cname
db.getCollectionNames()
db.getLastError() - just returns the err msg string
db.getLastErrorObj() - return full status object
db.getMongo() get the server connection object
db.getMongo().setSlaveOk() allow this connection to read from the nonmaster member of a replica pair
db.getName()
db.getPrevError()
db.getProfilingLevel()
db.getReplicationInfo()
db.getSisterDB(name) get the db at the same server as this onew
db.killOp() kills the current operation in the db
db.printCollectionStats()
db.printReplicationInfo()
db.printSlaveReplicationInfo()
db.printShardingStatus()
db.removeUser(username)
db.repairDatabase()
db.resetError()
db.runCommand(cmdObj) run a database command. if cmdObj is a string, turns it into { cmdObj : 1 }
db.setProfilingLevel(level) 0=off 1=slow 2=all
db.shutdownServer()
db.version() current version of the server
DBCollection help
db.foo.count()
db.foo.dataSize()
db.foo.distinct( key ) - eg. db.foo.distinct( 'x' )
db.foo.drop() drop the collection
db.foo.dropIndex(name)
db.foo.dropIndexes()
db.foo.ensureIndex(keypattern,options) - options should be an object with these possible fields: name, unique, dropDups
db.foo.find( [query] , [fields]) - first parameter is an optional queryfilter. second parameter is optional set of fields to return. e.g. db.foo.find( { x : 77 } , { name : 1 , x : 1 } )
db.foo.find(...).count()
db.foo.find(...).limit(n)
db.foo.find(...).skip(n)
db.foo.find(...).sort(...)
db.foo.findOne([query])
db.foo.getDB() get DB object associated with collection
db.foo.getIndexes()
db.foo.group( { key : ..., initial: ..., reduce : ...[, cond: ...] } )
db.foo.mapReduce( mapFunction , reduceFunction , <optional params> )
db.foo.remove(query)
db.foo.renameCollection( newName ) renames the collection
db.foo.save(obj)
db.foo.stats()
db.foo.storageSize() - includes free space allocated to this collection
db.foo.totalIndexSize() - size in bytes of all the indexes
db.foo.totalSize() - storage allocated for all data and indexes
db.foo.update(query, object[, upsert_bool])
db.foo.validate() - SLOW
db.foo.getShardVersion() - only for use with sharding
发表评论
-
proxool试用
2014-03-26 14:00 973配置文件: <?xml version=" ... -
DB2联合数据库配置实例(转载)
2010-06-21 17:11 1771由于需要使用到两台机器上的db2数据库读取数据的需求,因此使用 ... -
db2的sql语句报错的状态码的解释
2009-11-04 20:57 4357含义 要获得子代码, 参阅... 00 完全成功完成 表 3 ... -
sql在不同数据库查询前几条数据
2009-10-15 12:54 1974sql在不同数据库查询前几条数据 1. ORACLE S ... -
db2数据库表的导入导出数据库表
2009-10-14 20:47 1950导出表结构,命令行如下: db2look -d dbname ... -
利用索引优化sql语句
2009-07-24 15:28 1503转载地址:http://www.cnblo ... -
mysql的优化
2009-03-13 09:15 1173地址:http://www.blogjava.net/wang ... -
Hibernate中text字段诡异出错
2009-03-10 17:45 3184Hibernate中text字段诡异出错 描述:最初的sql语 ... -
mysql存储过程总结
2009-03-05 09:35 3700mysql存储过程的例子: DELIMITER $$ ... -
IN与EXISTS和INNER JOIN执行效率
2008-12-30 19:21 4104主要是查询日志里面的数据个数,过滤掉一些非法ip,手机上的,因 ... -
从一个数据库导入到另一个数据库中
2008-12-24 18:48 5910从一个数据库导入到另一个数据库中 package cn.d ... -
sql去除重复以及列转行sql语句
2008-12-24 11:37 7893工作中非常实用的sql语句 数据: userid si ... -
mysql数据库备份
2008-12-19 21:50 1268-- 备份 test_database 数据库 /usr/bi ... -
mysql(免安装版)的一些基本命令
2008-12-04 22:57 1504mysql中的命令行操作: 1、默认的用户名是root,密码是 ... -
两个数据库的更新操作
2008-11-10 14:09 1359两个数据库的更新操作,把一个数据库中的表的数据更新到另一个数据 ... -
set命令详解
2008-10-20 12:03 1520一、用set命令设置自定义变量 显示、设置或删除 cmd.ex ... -
数据库备份(ms sql server)
2008-10-13 15:04 1380@ECHO off ECHO database ba ... -
数据库还原(ms sql server)
2008-10-13 15:02 1536@ECHO off ECHO database ba ...
相关推荐
NosqlBooster 5.2.8是该工具的一个版本,提供了一系列增强的功能和优化的用户体验。 NosqlBooster 4Mongo的主要特点包括: 1. **用户友好的界面**:它采用直观的GUI设计,使用户能够轻松地浏览、查询、编辑和管理...
MongoDB是一种流行的开源文档型数据库,属于NoSQL数据库范畴,以其灵活性、高性能和高可扩展性而备受青睐。"mongo-linux,nosqlbooster....对于初次接触MongoDB或希望优化工作流程的人来说,这是一个非常有价值的资源。
MongoDB初体验:深入理解NoSQL数据库的魅力 MongoDB是一种流行的开源、分布式文档数据库,它属于NoSQL数据库的一种。在当今大数据和云计算的时代背景下,MongoDB因其灵活性、高性能和易于扩展性而备受青睐。本文将...
ReactJS 是React的一个版本,专门用于构建服务器端渲染(SSR)的应用,它可以帮助优化SEO并提高初次加载页面的速度。在电影微服务中,ReactJS可以用于生成预渲染的HTML,提高用户体验。 JavaScript 作为Web开发的...
在当今快速发展的Web开发领域,JavaScript框架不断涌现,其中Meteor.js以其独特的全栈式开发体验,吸引了众多开发者的眼球。本项目"simple-todo-list"正是基于Meteor.js进行的初次尝试,旨在通过构建一个简单的待办...