MongoDB 数据库管理(不定时更新)
之前的几篇文章大致说了副本集的搭建、副本集的管理,现在说下MongoDB数据库的管理。数据库管理包括:备份、还原、导入、导出、服务器管理等。
一:查看服务器状态,查看命令行参数。db.serverStatus()、db.serverCmdLineOpts()
- zjy:PRIMARY> db.serverStatus()
- {
- "host" : "zhoujinyi",
- "version" : "3.0.4",
- "process" : "mongod",
- "pid" : NumberLong(),
- "uptime" : ,
- "uptimeMillis" : NumberLong(),
- "uptimeEstimate" : ,
- "localTime" : ISODate("2015-07-01T14:06:12.922Z"),
- "asserts" : {
- "regular" : ,
- "warning" : ,
- "msg" : ,
- "user" : ,
- "rollovers" :
- },
- "backgroundFlushing" : {
- "flushes" : ,
- "total_ms" : ,
- "average_ms" : 4.180722891566265,
- "last_ms" : ,
- "last_finished" : ISODate("2015-07-01T14:05:47.284Z")
- },
- "connections" : {
- "current" : ,
- "available" : ,
- "totalCreated" : NumberLong()
- },
- ...
- ...
- "network" : {
- "bytesIn" : ,
- "bytesOut" : ,
- "numRequests" :
- },
- "opcounters" : {
- "insert" : ,
- "query" : ,
- "update" : ,
- "delete" : ,
- "getmore" : ,
- "command" :
- },
- "opcountersRepl" : {
- "insert" : ,
- "query" : ,
- "update" : ,
- "delete" : ,
- "getmore" : ,
- "command" :
- },
- "repl" : {
- "setName" : "zjy",
- "setVersion" : ,
- "ismaster" : true,
- "secondary" : false,
- "hosts" : [
- "127.0.0.1:27017",
- "127.0.0.1:27018",
- "127.0.0.1:27019"
- ],
- "primary" : "127.0.0.1:27017",
- "me" : "127.0.0.1:27017",
- "electionId" : ObjectId("5592be327c7062c30c3bff24"),
- "rbid" :
- },
- "storageEngine" : {
- "name" : "mmapv1"
- },
- "writeBacksQueued" : false,
- "mem" : {
- "bits" : ,
- "resident" : ,
- "virtual" : ,
- "supported" : true,
- "mapped" : ,
- "mappedWithJournal" :
- },
- ...
- ...
- "ok" :
- }
通过上面看到MongoDB的版本、后台刷写情况、副本集情况、操作数量情况、进出网络情况、连接数情况和内存情况。
其中内存相关字段的含义是:单位是M
mapped:映射到内存的数据大小
visze:占用的虚拟内存大小
res:实际使用的内存大小
在上面的结果中,virtual是mapped的两倍,而mapped等于数据文件的大小,所以说vsize是数据文件的两倍,之所以会这样,是因为本例中,MongoDB开启了journal,需要在内存里多映射一次数据文件,如果关闭journal,则virtual和mapped大致相当。
也可以通过mongostat来查看:
- root@zhoujinyi:~# mongostat
- insert query update delete getmore command flushes mapped vsize res faults qr|qw ar|aw netIn netOut conn set repl time
- * * * * | .5G .5G 133.0M | | 262b 11k zjy PRI ::
- * * * * | .5G .5G 133.0M | | 215b 11k zjy PRI ::
- * * * * | .5G .5G 133.0M | | 215b 11k zjy PRI ::
faults:查询从磁盘读取数据,标志服务器未达到最佳,所需的数据并未完全保存找内存中
qr/qw:队列等待的数目。
ar/aw:活动客户端的数目。
conn:打开的连接数。
flushes:数据刷写到磁盘的数目。
vsize:使用虚拟内存大小。
mapped:隐射的内存大小,约等于数据目录大小。
查看命令行参数:
- zjy:PRIMARY> db.serverCmdLineOpts()
- {
- "argv" : [
- "mongod",
- "-f",
- "/etc/mongodb/mongodb_27017.conf"
- ],
- "parsed" : {
- "config" : "/etc/mongodb/mongodb_27017.conf",
- "diaglog" : ,
- "net" : {
- "maxIncomingConnections" : ,
- "port" : ,
- "unixDomainSocket" : {
- "pathPrefix" : "/tmp"
- }
- },
- "processManagement" : {
- "fork" : true,
- "pidFilePath" : "/var/run/mongo_27017.pid"
- },
- "replication" : {
- "replSet" : "zjy/127.0.0.1:27018"
- },
- "storage" : {
- "dbPath" : "/usr/local/mongo1/",
- "mmapv1" : {
- "nsSize" :
- }
- },
- "systemLog" : {
- "destination" : "file",
- "logAppend" : true,
- "path" : "/var/log/mongodb/mongodb1.log"
- }
- },
- "ok" :
- }
二:查看数据库/表状态,db.stats()/db.coll.stats() | M为单位:db.stats(1024*1024)/db.coll.stats(1024*1024)
- zjy:PRIMARY> db.stats()
- {
- "db" : "test",
- "collections" : ,
- "objects" : ,
- "avgObjSize" : 417.1111111111111,
- "dataSize" : , #数据文件大小。
- "storageSize" : , #存储空间大小:datasize+集合两端预留的未使用空间。
- "numExtents" : ,
- "indexes" : ,
- "indexSize" : ,
- "fileSize" : , #物理文件大小:包括预分配
- "nsSizeMB" : ,
- "extentFreeList" : {
- "num" : ,
- "totalSize" :
- },
- "dataFileVersion" : {
- "major" : ,
- "minor" :
- },
- "ok" :
- }
通过上面看到数据库的名称,集合(表)数量,索引数量、大小,数据文件大小,存储空间大小和物理文件大小。
三:查看当前Query执行情况:db.currentOP():
- zjy:PRIMARY> db.currentOP()
- {
- "inprog" : [
- {
- "desc" : "conn4732", #可与日志信息联系起来
- "threadId" : "0x33903c0",
- "connectionId" : , #连接ID
- "opid" : , #操作标识,可以用这个ID来终止该操作:db.killOP(opid)
- "active" : true, #表示线程是否在运行
- "secs_running" : , #执行的时间
- "microsecs_running" : NumberLong(),
- "op" : "getmore", #操作类型:插入、删除、更新、查询
- "ns" : "local.oplog.rs", #操作的集合
- "query" : {
- "ts" : {
- "$gte" : Timestamp(, )
- }
- },
- "client" : "127.0.0.1:52101",
- "numYields" : , #表示该操作交出锁,而使其他操作得以运行。
- "locks" : { #锁信息
- },
- "waitingForLock" : false,
- "lockStats" : {
- "Global" : {
- "acquireCount" : {
- "r" : NumberLong()
- }
- },
- "MMAPV1Journal" : {
- "acquireCount" : {
- "r" : NumberLong()
- }
- },
- "Database" : {
- "acquireCount" : {
- "r" : NumberLong()
- }
- },
- "oplog" : {
- "acquireCount" : {
- "R" : NumberLong()
- }
- }
- }
- }
...
...
通过上面看到当前执行的进程,类似MySQL的show processlist。可以添加过滤条件:
- zjy:PRIMARY> db.currentOP({"ns":"test"})
四:监控MongoDB各个状态:mongotop、mongostat
- root@zhoujinyi:~# mongotop #查看那个几个最繁忙
- ns total read write --01T11::-:
- abc 0ms 0ms 0ms
- abc.AOE 0ms 0ms 0ms
- abc.aoe 0ms 0ms 0ms
- abc.system.indexes 0ms 0ms 0ms
- abc.system.js 0ms 0ms 0ms
- abc.system.namespaces 0ms 0ms 0ms
- abc.test 0ms 0ms 0ms
- admin.system.indexes 0ms 0ms 0ms
- admin.system.namespaces 0ms 0ms 0ms
- admin.system.roles
- root@zhoujinyi:~# mongostat
- insert query update delete getmore command flushes mapped vsize res faults qr|qw ar|aw netIn netOut conn set repl time
- * * * * | .5G .5G 133.0M | | 215b 11k zjy PRI ::
- * * * * | .5G .5G 133.0M | | 215b 11k zjy PRI ::
- * * * * | .5G .5G 133.0M | | 215b 11k zjy PRI ::
- * * * * | .5G .5G 133.0M | | 262b 11k zjy PRI ::
上面insert、query、update、delete、getmore、command 每种对应操作的发生次数。其中faults表示访问失败数,数据从内存交换出去,放到swap。值越小越好,最好不要大于100。
- flushes:表示刷写到磁盘的次数。
- mapped:表示映射到内存的数量,约等于数据目录大小。
- vsize:表示正在使用的虚拟内存大小,通常为数据目录的2倍。(一次用于映射,一次用于日志系统)
- res:表示正在使用的内存大小。
- qr|qw:表示读写操作队列大小,即有多少读写操作被阻塞,等待进行处理。
- ar|aw:表示活动客户端的数量,即正在进行读写操作的客户端。
- netId:表示通过网络传输进来的字节数。
- netou:t表示通过网络传输出的字节数。
- Conn:表示服务器打开的连接数。
- time:表示统计的时间。
其中mongostat加上--discover 可以查看到副本集和分片集群的所有成员状态
五:日志分割,db.adminCommand({"logRotate":1})
- zjy:PRIMARY> db.adminCommand({"logRotate":})
- { "ok" : }
类似MySQL的flush log。
六:数据库备份、还原,mongodump、mongorestore、mongoimport、mongoexport
mongodump --help :参数
- Export MongoDB data to BSON files.
- Options:
- --help produce help message
- -v [ --verbose ] be more verbose (include multiple times
- for more verbosity e.g. -vvvvv)
- --quiet silence all non error diagnostic
- messages
- --version print the program's version and exit
- -h [ --host ] arg mongo host to connect to ( <set
- name>/s1,s2 for sets)
- --port arg server port. Can also use --host
- hostname:port
- --ipv6 enable IPv6 support (disabled by
- default)
- -u [ --username ] arg username
- -p [ --password ] arg password
- --authenticationDatabase arg user source (defaults to dbname)
- --authenticationMechanism arg (=MONGODB-CR)
- authentication mechanism
- --gssapiServiceName arg (=mongodb) Service name to use when authenticating
- using GSSAPI/Kerberos
- --gssapiHostName arg Remote host name to use for purpose of
- GSSAPI/Kerberos authentication
- --dbpath arg directly access mongod database files
- in the given path, instead of
- connecting to a mongod server - needs
- to lock the data directory, so cannot
- be used if a mongod is currently
- accessing the same path
- --directoryperdb each db is in a separate directory
- (relevant only if dbpath specified)
- --journal enable journaling (relevant only if
- dbpath specified)
- -d [ --db ] arg database to use
- -c [ --collection ] arg collection to use (some commands)
- -o [ --out ] arg (=dump) output directory or "-" for stdout
- -q [ --query ] arg json query
- --oplog Use oplog for point-in-time
- snapshotting
- --repair try to recover a crashed database
- --forceTableScan force a table scan (do not use
- $snapshot)
- --dumpDbUsersAndRoles Dump user and role definitions for the
- given database
各种备份方式:
- 无账号、密码
- mongodump -o backup #备份所有数据库到backup目录下,每个数据库一个文件,除local数据库外。
- mongodump -d abc -o backup #备份abc数据库到backup目录下。
- mongodump -d abc -c ddd -o backup #备份abc数据库下的ddd集合。
- #有账号、密码
- mongodump -udba -pdba -d abc -c ddd -o backup #备份abc数据库下的ddd集合。
- mongodump --host=127.0.0.1 --port= -udba -p --db=abc --collection=ddd -o backup
这里需要注意的是:在认证备份中,比如在abc数据库中,需要其有dba这个账号才可以执行备份,要是abc数据库里没有账号,那么需要在admin上认证,再执行需要加:authenticationDatabase 参数:指定保存用户凭证的数据库,没有指定则去-d指定的数据库认证。最好还是设置专本备份的账号。
- mongodump -udba -pdba -d abc --authenticationDatabase admin -o backup #在admin数据库下认证之后再去备份abc数据库。
mongorestore --help :参数
- Import BSON files into MongoDB.
- usage: mongorestore [options] [directory or filename to restore from]
- Options:
- --help produce help message
- -v [ --verbose ] be more verbose (include multiple times
- for more verbosity e.g. -vvvvv)
- --quiet silence all non error diagnostic
- messages
- --version print the program's version and exit
- -h [ --host ] arg mongo host to connect to ( <set
- name>/s1,s2 for sets)
- --port arg server port. Can also use --host
- hostname:port
- --ipv6 enable IPv6 support (disabled by
- default)
- -u [ --username ] arg username
- -p [ --password ] arg password
- --authenticationDatabase arg user source (defaults to dbname)
- --authenticationMechanism arg (=MONGODB-CR)
- authentication mechanism
- --gssapiServiceName arg (=mongodb) Service name to use when authenticating
- using GSSAPI/Kerberos
- --gssapiHostName arg Remote host name to use for purpose of
- GSSAPI/Kerberos authentication
- --dbpath arg directly access mongod database files
- in the given path, instead of
- connecting to a mongod server - needs
- to lock the data directory, so cannot
- be used if a mongod is currently
- accessing the same path
- --directoryperdb each db is in a separate directory
- (relevant only if dbpath specified)
- --journal enable journaling (relevant only if
- dbpath specified)
- -d [ --db ] arg database to use
- -c [ --collection ] arg collection to use (some commands)
- --objcheck validate object before inserting
- (default)
- --noobjcheck don't validate object before inserting
- --filter arg filter to apply before inserting
- --drop drop each collection before import
- --oplogReplay replay oplog for point-in-time restore
- --oplogLimit arg include oplog entries before the
- provided Timestamp (seconds[:ordinal])
- during the oplog replay; the ordinal
- value is optional
- --keepIndexVersion don't upgrade indexes to newest version
- --noOptionsRestore don't restore collection options
- --noIndexRestore don't restore indexes
- --restoreDbUsersAndRoles Restore user and role definitions for
- the given database
- --w arg (=) minimum number of replicas per write
各种还原方式:
- mongorestore -udba -pdba -d abc backup/abc #还原abc数据库。
- mongorestore -udba -pdba -d abc --drop backup/abc #还原之前先删除原来数据库(集合)。
- mongorestore -udba -pdba -d abc -c ddd --drop backup/abc/ddd.bson #还原abc库中的ddd集合。
- mongorestore --host=127.0.0.1 --port= -udba -pdba -d abc -c test --drop backup/abc/test.bson #还原abc库中的test集合。
- mongorestore --host=127.0.0.1 --port= -udba -pdba -d abc -c ooo --drop backup/abc/test.bson #还原abc库中的test集合到ooo集合。
mongoexport --help :参数
- Export MongoDB data to CSV, TSV or JSON files.
- Options:
- --help produce help message
- -v [ --verbose ] be more verbose (include multiple times
- for more verbosity e.g. -vvvvv)
- --quiet silence all non error diagnostic
- messages
- --version print the program's version and exit
- -h [ --host ] arg mongo host to connect to ( <set
- name>/s1,s2 for sets)
- --port arg server port. Can also use --host
- hostname:port
- --ipv6 enable IPv6 support (disabled by
- default)
- -u [ --username ] arg username
- -p [ --password ] arg password
- --authenticationDatabase arg user source (defaults to dbname)
- --authenticationMechanism arg (=MONGODB-CR)
- authentication mechanism
- --gssapiServiceName arg (=mongodb) Service name to use when authenticating
- using GSSAPI/Kerberos
- --gssapiHostName arg Remote host name to use for purpose of
- GSSAPI/Kerberos authentication
- --dbpath arg directly access mongod database files
- in the given path, instead of
- connecting to a mongod server - needs
- to lock the data directory, so cannot
- be used if a mongod is currently
- accessing the same path
- --directoryperdb each db is in a separate directory
- (relevant only if dbpath specified)
- --journal enable journaling (relevant only if
- dbpath specified)
- -d [ --db ] arg database to use
- -c [ --collection ] arg collection to use (some commands)
- -f [ --fields ] arg comma separated list of field names
- e.g. -f name,age
- --fieldFile arg file with field names - per line
- -q [ --query ] arg query filter, as a JSON string, e.g.,
- '{x:{$gt:1}}'
- --csv export to csv instead of json
- -o [ --out ] arg output file; if not specified, stdout
- is used
- --jsonArray output to a json array rather than one
- object per line
- -k [ --slaveOk ] arg (=) use secondaries for export if
- available, default true
- --forceTableScan force a table scan (do not use
- $snapshot)
- --skip arg (=) documents to skip, default
- --limit arg (=) limit the numbers of documents
- returned, default all
- --sort arg sort order, as a JSON string, e.g.,
- '{x:1}'
- mongoexport -udba -pdba -dabc -cddd --authenticationDatabase admin -o backup/ddd.txt #导出txt文本
- mongoexport -udba -pdba -dabc -cddd -f sno,sname --authenticationDatabase admin -o backup/ddd.txt #指定字段导出txt文本
- mongoexport -udba -pdba -dabc -cddd -f sno,sname --csv --authenticationDatabase admin -o backup/ddd.csv #导出成csv格式的需要指定字段-f
- mongoexport -udba -pdba -dabc -cddd -q '{"sno":{"$gte":5}}' -f sno,sname --csv --authenticationDatabase admin -o backup/ddd.csv #按照-q里的条件导出
mongoimport --help :参数
- Import CSV, TSV or JSON data into MongoDB.
- When importing JSON documents, each document must be a separate line of the input file.
- Example:
- mongoimport --host myhost --db my_cms --collection docs < mydocfile.json
- Options:
- --help produce help message
- -v [ --verbose ] be more verbose (include multiple times
- for more verbosity e.g. -vvvvv)
- --quiet silence all non error diagnostic
- messages
- --version print the program's version and exit
- -h [ --host ] arg mongo host to connect to ( <set
- name>/s1,s2 for sets)
- --port arg server port. Can also use --host
- hostname:port
- --ipv6 enable IPv6 support (disabled by
- default)
- -u [ --username ] arg username
- -p [ --password ] arg password
- --authenticationDatabase arg user source (defaults to dbname)
- --authenticationMechanism arg (=MONGODB-CR)
- authentication mechanism
- --gssapiServiceName arg (=mongodb) Service name to use when authenticating
- using GSSAPI/Kerberos
- --gssapiHostName arg Remote host name to use for purpose of
- GSSAPI/Kerberos authentication
- --dbpath arg directly access mongod database files
- in the given path, instead of
- connecting to a mongod server - needs
- to lock the data directory, so cannot
- be used if a mongod is currently
- accessing the same path
- --directoryperdb each db is in a separate directory
- (relevant only if dbpath specified)
- --journal enable journaling (relevant only if
- dbpath specified)
- -d [ --db ] arg database to use
- -c [ --collection ] arg collection to use (some commands)
- -f [ --fields ] arg comma separated list of field names
- e.g. -f name,age
- --fieldFile arg file with field names - per line
- --ignoreBlanks if given, empty fields in csv and tsv
- will be ignored
- --type arg type of file to import. default: json
- (json,csv,tsv)
- --file arg file to import from; if not specified
- stdin is used
- --drop drop collection first
- --headerline first line in input file is a header
- (CSV and TSV only)
- --upsert insert or update objects that already
- exist
- --upsertFields arg comma-separated fields for the query
- part of the upsert. You should make
- sure this is indexed
- --stopOnError stop importing at first error rather
- than continuing
- --jsonArray load a json array, not one item per
- line. Currently limited to 16MB.
- mongoimport -udba -pdba -dabc -ciii --authenticationDatabase admin < backup/ddd.txt #导入到iii集合
- mongoimport -udba -pdba -dabc -ceee --type=csv --headerline --authenticationDatabase admin < backup/ddd.csv #csv导入,需要指定headerline
- mongoimport -udba -pdba -dabc -ceee --type=csv --headerline --ignoreBlanks --drop --authenticationDatabase admin < backup/ddd.csv #不导入空字段,指定ignoreBlanks。
七:压缩数据文件,compact
- zjy:PRIMARY> db.runCommand({compact:"cdt1"}) #整理并重组数据文件中指定集合的数据结构,不会释放磁盘空间。
- { "ok" : }
八:修复索引、验证集合,reindex,validate
- zjy:PRIMARY> db.cdt1.reIndex() #修复索引
- {
- "nIndexesWas" : ,
- "nIndexes" : ,
- "indexes" : [
- {
- "key" : {
- "_id" :
- },
- "name" : "_id_",
- "ns" : "cde.cdt1"
- },
- {
- "unique" : true,
- "key" : {
- "b" : ,
- "date" :
- },
- "name" : "b_1_date_1",
- "ns" : "cde.cdt1"
- }
- ],
- "ok" :
- }
- zjy:PRIMARY> db.abc.validate() #验证集合是否有问题,验证集合内容
- {
- "ns" : "test.abc",
- "datasize" : ,
- "nrecords" : ,
- "lastExtentSize" : ,
- "firstExtent" : "0:5000 ns:test.abc",
- "lastExtent" : "0:5000 ns:test.abc",
- "extentCount" : ,
- "firstExtentDetails" : {
- "loc" : "0:5000",
- "xnext" : "null",
- "xprev" : "null",
- "nsdiag" : "test.abc",
- "size" : ,
- "firstRecord" : "0:50b0",
- "lastRecord" : "0:5330"
- },
- "deletedCount" : , #删除的文档数量
- "deletedSize" : , #删除的文档大小
- "nIndexes" : ,
- "keysPerIndex" : {
- "test.abc.$_id_" :
- },
- "valid" : true,
- "errors" : [ ],
- "warning" : "Some checks omitted for speed. use {full:true} option to do more thorough scan.", #使用true,可以看详细信息:db.abc.validate(true)
- "ok" :
- }
九:日志Journal相关,通过db.serverstatus()查看,相关介绍:文章1和文章2
- zjy:PRIMARY> db.serverStatus().dur
- {
- "commits" : , #在journalCommitInterval时间内提交的操作数
- "journaledMB" : 0.032768, #在journalCommitInterval时间内写到journal文件中的数据量
- "writeToDataFilesMB" : 0.00509, #在journalCommitInterval时间内从journal刷新到磁盘的数据量
- "compression" : 6.017998163452709,#表示客户端提交写入到journal的数据的压缩比率,注意,写入到journal的数据并不是全部的数据。( journaled_size_of_data / uncompressed_size_of_data )
- "commitsInWriteLock" : , #在有写锁的情况下提交的数量,这表示写的压力很大
- "earlyCommits" : , #表示在journalCommitInterval之前的时间,mongod请求提交的次数。用这个参数确定journalCommitInterval是不是设置的过长。
- "timeMs" : {
- "dt" : ,
- "prepLogBuffer" : , #从privateView映射到Logbuffer的时间
- "writeToJournal" : , #从logbuffer刷新到journalfile 的时间
- "writeToDataFiles" : , #从journalbuffer映射到MMF,然后从MMF刷新到磁盘的时间,文件系统和磁盘会影响写入性能
- "remapPrivateView" : 0 #重新映射数据到PrivateView的时间,越小性能越好
- },
- "journalCommitIntervalMs" :
- }
十:刷写并锁 db.fsyncLock(),db.fsyncUnlock()
- drug:PRIMARY>db.fsyncLock() #刷写到磁盘,并锁住数据库。此时数据库只能读,不能写。保证了数据的一致性,在此可以进行复制文件或则快照备份
- {
- "info" : "now locked against writes, use db.fsyncUnlock() to unlock",
- "seeAlso" : "http://dochub.mongodb.org/core/fsynccommand",
- "ok" :
- }
- drug:PRIMARY> db.currentOP() #查看锁情况
- {
- "inprog" : [
- ...
- ...
- ],
- "fsyncLock" : true,
- "info" : "use db.fsyncUnlock() to terminate the fsync write/snapshot lock"
- }
- drug:PRIMARY> db.fsyncUnlock() #解锁
- { "ok" : , "info" : "unlock completed" }
十一:
MongoDB 数据库管理(不定时更新)的更多相关文章
- iOS 属性修饰符记录 --不定时更新
重新审视了一下OC在属性修饰符,特意记录一下来.以后不定时更新 > retain:只有在非ARC下才会有效,所有如果在ARC下使用了retain修饰也白搭 如以下的data属性用retain修饰 ...
- MongoDB 文档的更新操作
在MongoDB中,更新单个doc的操作是原子性的.默认情况下,如果一个update操作更新多个doc,那么对每个doc的更新是原子性的,但是对整个update 操作而言,不是原子性的,可能存在前面的 ...
- linux下svn定时更新项目
方法一.用shell脚本定时更新项目 1.进入网站的根目录,假设项目位置放在/var/www/test cd /var/www/test 2.建立脚本文件update.sh,分两步进行.首先利 ...
- 三、MongoDB的创建、更新和删除
一.MongoDB的下载.安装与部署 二.MongoDB的基础知识简介 三.MongoDB的创建.更新和删除 概要 下面开始学习MongoDB最重要也是最基础的部分:C(创建)R(查询)U(更新)D( ...
- ASP.NET中设置一个定时器来定时更新 转
asp.net 定时器 比较少用, 中国红木网这是一个相当实用的功能,有了RSS博客镜像,就不需要在多处同时发布博客日志了.比如你同时在新浪上有自己的博客,又同时有自己的个人博客站点,那么你只需要在 ...
- MongoDB数组修改器更新数据(转)
MongoDB数组修改器更新数据 这里,我们将了解一下数组修改器.数组,是我们经常看到和使用到的且非常有用的数据结构:它不仅可以通过索进行引用,还可以作为集合来使用.数组修改器,顾名思义,它是用 ...
- Vivado_MicroBlaze_问题及解决方法_汇总(不定时更新)
Vivado_MicroBlaze_问题及解决方法_汇总(不定时更新) 标签: Vivado 2015-07-03 14:35 4453人阅读 评论(0) 收藏 举报 分类: 硬件(14) 版权声 ...
- Java日志组件logback使用:加载非类路径下的配置文件并设置定时更新
Java日志组件logback使用:加载非类路径下的配置文件并设置定时更新 摘自: https://blog.csdn.net/johnson_moon/article/details/7887449 ...
- [Android Traffic] 调整定时更新的频率(C2DM与退避算法)
转载自: http://blog.csdn.net/kesenhoo/article/details/7395253 Minimizing the Effect of Regular Updates[ ...
- Java专业技能面试问题(不定时更新)
刚看到园友五月的仓颉<面试感悟----一名3年工作经验的程序员应该具备的技能>感觉很不错,不论是为面试跳槽准备,还是打算深化精进自己的技术都可以参考一下.面向工资编程多少也有点道理,虽然技 ...
随机推荐
- 简谈switch case
工作中从buff里截取了一个字符串,然后和配置文件中的字符串名字对比 ,如果一样,处理,不一样,elseif 再判断,再处理! switch(){case : case :...... }先说语法,再 ...
- echo '.SUFFIXES: .cpp' >> ${OUTPUT_FILE}
当前makefile或shell内支持文件后缀的类型列表,意思是文件支持.cpp结尾的类型,并且将他,输出到OUTPUT_FILE函数. 见网上有人说: “makefile中 .SUFFIXES: . ...
- 手把手教你如何把java代码,打包成jar文件以及转换为exe可执行文件
1.背景: 学习java时,教材中关于如题问题,只有一小节说明,而且要自己写麻烦的配置文件,最终结果却只能转换为jar文件.实在是心有不爽.此篇博客教你如何方便快捷地把java代码,打包成jar文件以 ...
- Linux内核循环链表经典分析和移植
为什么说这个链表做的经典呢,哥哥我从Linux内核里边儿扣出来的,要么怎么说内核不是一般人能写的,这代码太TM优美了! 这里有一篇参考文章:http://isis.poly.edu/kulesh/st ...
- Java实验1-文件IO
目标:掌握Java类的创建,Java I/O操作,Java集合类的使用等 内容: 王老师非常喜欢读书,为了便于查阅,他每次买书回家后就在笔记本上登记每本书的详细信息(书名.作者.出版社.出版日期.价 ...
- .NET中的工作目录一览!
定义: 当前工作目录——进行某项操作的目的目录,会随着OpenFileDialog.SaveFileDialog等对象所确定的目录而改变. 当前执行目录——该进程从中启动的目录,即文件自身 ...
- 快速切换IP的批处理!
内容如下: @echo off color 1A Title [SMART专用 IP设置V1.0] cls echo. echo SMART专用 IP设置V1.0 %date%%time% echo. ...
- 第九天 iOS音频技术
1. AQRecorder mRecordFormat.mFormatID = inFormatID; if (inFormatID == kAudioFormatLinearPCM) { // if ...
- Android开发学习笔记--一个有界面A+B的计算器
做了一个A+B的APP,虽然很简单,但是作为初学者还是弄了几个小时才弄好,什么东西都要看书或者百度,但最后成功了,还是很开心的,收货蛮大的.现在把过程写一下: 首先给出效果图: 一开始布局一直有问题, ...
- iOS开发——UI进阶篇(八)pickerView简单使用,通过storyboard加载控制器,注册界面,通过xib创建控制器,控制器的view创建,导航控制器的基本使用
一.pickerView简单使用 1.UIPickerViewDataSource 这两个方法必须实现 // 返回有多少列 - (NSInteger)numberOfComponentsInPicke ...