上一篇:每篇半小时1天入门MongoDB——1.MongoDB介绍和安装

前言:为什么不是1天精通?大家都是成年人、明白人、聪明人,就不要像忽悠小孩子一样啦.......入门容易精通难,入门可能1天,精通则可能十年磨一剑才略有所成......

配置环境变量

Win10系统为例

右键单击“此电脑”——属性——高级系统设置——高级——环境变量,添加C:\Program Files\MongoDB\Server\3.0\bin;。注意:要以;隔开各种变量。

这样的话就可以直接在CMD命令窗口中输入mongo

表示环境变量设置成功,并已经连接到默认数据库test中。

我们可以输入mongod --help来查看相关的帮助信息

  1. C:\Users\zouqi>mongod --help
  2. Options:
  3.  
  4. General options:
  5. -h [ --help ] show this usage information
  6. --version show version information
  7. -f [ --config ] arg configuration file specifying additional options
  8. -v [ --verbose ] [=arg(=v)] be more verbose (include multiple times for more
  9. verbosity e.g. -vvvvv)
  10. --quiet quieter output
  11. --port arg specify port number - 27017 by default
  12. --bind_ip arg comma separated list of ip addresses to listen on
  13. - all local ips by default
  14. --ipv6 enable IPv6 support (disabled by default)
  15. --maxConns arg max number of simultaneous connections - 1000000
  16. by default
  17. --logpath arg log file to send write to instead of stdout - has
  18. to be a file, not directory
  19. --logappend append to logpath instead of over-writing
  20. --logRotate arg set the log rotation behavior (rename|reopen)
  21. --timeStampFormat arg Desired format for timestamps in log messages.
  22. One of ctime, iso8601-utc or iso8601-local
  23. --pidfilepath arg full path to pidfile (if not set, no pidfile is
  24. created)
  25. --keyFile arg private key for cluster authentication
  26. --setParameter arg Set a configurable parameter
  27. --httpinterface enable http interface
  28. --clusterAuthMode arg Authentication mode used for cluster
  29. authentication. Alternatives are
  30. (keyFile|sendKeyFile|sendX509|x509)
  31. --auth run with security
  32. --noauth run without security
  33. --jsonp allow JSONP access via http (has security
  34. implications)
  35. --rest turn on simple rest api
  36. --slowms arg (=100) value of slow for profile and console log
  37. --profile arg 0=off 1=slow, 2=all
  38. --cpu periodically show cpu and iowait utilization
  39. --sysinfo print some diagnostic system information
  40. --noIndexBuildRetry don't retry any index builds that were
  41. interrupted by shutdown
  42. --noscripting disable scripting engine
  43. --notablescan do not allow table scans
  44.  
  45. Windows Service Control Manager options:
  46. --install install Windows service
  47. --remove remove Windows service
  48. --reinstall reinstall Windows service (equivalent to --remove
  49. followed by --install)
  50. --serviceName arg Windows service name
  51. --serviceDisplayName arg Windows service display name
  52. --serviceDescription arg Windows service description
  53. --serviceUser arg account for service execution
  54. --servicePassword arg password used to authenticate serviceUser
  55.  
  56. Replication options:
  57. --oplogSize arg size to use (in MB) for replication op log. default is
  58. 5% of disk space (i.e. large is good)
  59.  
  60. Master/slave options (old; use replica sets instead):
  61. --master master mode
  62. --slave slave mode
  63. --source arg when slave: specify master as <server:port>
  64. --only arg when slave: specify a single database to replicate
  65. --slavedelay arg specify delay (in seconds) to be used when applying
  66. master ops to slave
  67. --autoresync automatically resync if slave data is stale
  68.  
  69. Replica set options:
  70. --replSet arg arg is <setname>[/<optionalseedhostlist>]
  71. --replIndexPrefetch arg specify index prefetching behavior (if secondary)
  72. [none|_id_only|all]
  73.  
  74. Sharding options:
  75. --configsvr declare this is a config db of a cluster; default port
  76. 27019; default dir /data/configdb
  77. --shardsvr declare this is a shard db of a cluster; default port
  78.  
  79. SSL options:
  80. --sslOnNormalPorts use ssl on configured ports
  81. --sslMode arg set the SSL operation mode
  82. (disabled|allowSSL|preferSSL|requireSSL
  83. )
  84. --sslPEMKeyFile arg PEM file for ssl
  85. --sslPEMKeyPassword arg PEM file password
  86. --sslClusterFile arg Key file for internal SSL
  87. authentication
  88. --sslClusterPassword arg Internal authentication key file
  89. password
  90. --sslCAFile arg Certificate Authority file for SSL
  91. --sslCRLFile arg Certificate Revocation List file for
  92. SSL
  93. --sslDisabledProtocols arg Comma separated list of TLS protocols
  94. to disable [TLS1_0,TLS1_1,TLS1_2]
  95. --sslWeakCertificateValidation allow client to connect without
  96. presenting a certificate
  97. --sslAllowConnectionsWithoutCertificates
  98. allow client to connect without
  99. presenting a certificate
  100. --sslAllowInvalidHostnames Allow server certificates to provide
  101. non-matching hostnames
  102. --sslAllowInvalidCertificates allow connections to servers with
  103. invalid certificates
  104. --sslFIPSMode activate FIPS 140-2 mode at startup
  105.  
  106. Storage options:
  107. --storageEngine arg (=mmapv1) what storage engine to use
  108. --dbpath arg directory for datafiles - defaults to \data\db\
  109. which is C:\data\db\ based on the current
  110. working drive
  111. --directoryperdb each database will be stored in a separate
  112. directory
  113. --noprealloc disable data file preallocation - will often
  114. hurt performance
  115. --nssize arg (=16) .ns file size (in MB) for new databases
  116. --quota limits each database to a certain number of
  117. files (8 default)
  118. --quotaFiles arg number of files allowed per db, implies --quota
  119. --smallfiles use a smaller default file size
  120. --syncdelay arg (=60) seconds between disk syncs (0=never, but not
  121. recommended)
  122. --upgrade upgrade db if needed
  123. --repair run repair on all dbs
  124. --repairpath arg root directory for repair files - defaults to
  125. dbpath
  126. --journal enable journaling
  127. --nojournal disable journaling (journaling is on by default
  128. for 64 bit)
  129. --journalOptions arg journal diagnostic options
  130. --journalCommitInterval arg how often to group/batch commit (ms)
  131.  
  132. WiredTiger options:
  133. --wiredTigerCacheSizeGB arg maximum amount of memory to allocate
  134. for cache; defaults to 1/2 of physical
  135. RAM
  136. --wiredTigerStatisticsLogDelaySecs arg (=0)
  137. seconds to wait between each write to a
  138. statistics file in the dbpath; 0 means
  139. do not log statistics
  140. --wiredTigerJournalCompressor arg (=snappy)
  141. use a compressor for log records
  142. [none|snappy|zlib]
  143. --wiredTigerDirectoryForIndexes Put indexes and data in different
  144. directories
  145. --wiredTigerCollectionBlockCompressor arg (=snappy)
  146. block compression algorithm for
  147. collection data [none|snappy|zlib]
  148. --wiredTigerIndexPrefixCompression arg (=1)
  149. use prefix compression on row-store
  150. leaf pages

如果你不喜欢看英文可以网上搜中文帮助介绍。

mongoDB和关系型数据库的对比

  1. 关系数据的表的record必须保证拥有每一个field
  2. mongoDBde meiyige documentde key可以不一样
  3. 关系型数据库查询使用SQL
  4. mongoDB查询使用内置find函数——》基于BSON的特殊查询工具

Shell操作

  1. 创建一个数据库——use[databaseName]

    这时数据库并没有被正在创建,而是处于mongodb的一个预处理缓存池当中,如果你什么也不干就离开的花这个空数据库就会被删除。

  2. 查看所有数据库——show dbs

    1. > show dbs
    2. demo 0.078GB
    3. local 0.078GB
    4. myDatabase 0.078GB
    5. >

    这个时候我们看到myTest这个数据库是还没有创建的。

  3. 给指定数据库添加集合并且添加记录 ——db.[documentName].insert({...})

    1. > db.persons.insert({name:'yujie'})
    2. WriteResult({ "nInserted" : 1 })
    3. >

    执行上面语句后才真正创建数据库。

    1. > show dbs
    2. demo 0.078GB
    3. local 0.078GB
    4. myDatabase 0.078GB
    5. myTest 0.078GB
    6. >
  4. 查看数据库中的所有文档——show collections

    1. > show collections
    2. persons
    3. system.indexes
    4. >

    我们看到多了一个system.indexes文档,这是系统自动创建的一个索引文档,当插入记录的时候,自动创建了一个字段_id,并在这个字段上面创建了索引。我们来查看下索引:

    1. > db.system.indexes.find()
    2. { "v" : 1, "key" : { "_id" : 1 }, "name" : "_id_", "ns" : "myTest.persons" }
    3. >
  5. 查看指定文档的数据——db.[documentName].find()&db.[documentName].findOne()

    在这之前,我们再来往persons文档中插入一条记录

    1. > db.persons.insert({name:'楚留香'})
    2. WriteResult({ "nInserted" : 1 })
    3. >

    查找persons文档中的所有记录

    1. > db.persons.find()
    2. { "_id" : ObjectId("593959250ab68d9cc7011a93"), "name" : "yujie" }
    3. { "_id" : ObjectId("59395c350ab68d9cc7011a94"), "name" : "楚留香" }
    4. >

    查找persons文档中的第一条记录

    1. > db.persons.findOne()
    2. { "_id" : ObjectId("593959250ab68d9cc7011a93"), "name" : "yujie" }
    3. >
  6. 更新文档数据——db.[documentName].update({查询条件},{更新内容})

    这里我们用到了一个update方法,我们来看下它的几个参数分别代表什么

    参数1:查询的条件

    参数2:更新的字段

    参数3:如果不存在则插入

    参数4:是否允许修改多条记录

    更新name为yujie的记录

    1. > db.persons.update({name:'yujie'},{$set:{name:'玉杰'}})
    2. WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })

    查看更新后的记录:

    1. > db.persons.find()
    2. { "_id" : ObjectId("593959250ab68d9cc7011a93"), "name" : "玉杰" }
    3. { "_id" : ObjectId("59395c350ab68d9cc7011a94"), "name" : "楚留香" }
  7. 删除文档中的数据——db.[documentName].remove({...})

    插入一条测试记录

    1. > db.persons.insert({name:'test'})
    2. WriteResult({ "nInserted" : 1 })

    插入后:

    1. > db.persons.find()
    2. { "_id" : ObjectId("593959250ab68d9cc7011a93"), "name" : "玉杰" }
    3. { "_id" : ObjectId("59395c350ab68d9cc7011a94"), "name" : "楚留香" }
    4. { "_id" : ObjectId("593961530ab68d9cc7011a95"), "name" : "test" }
    5. >

    删除文档中的数据

    1. > db.persons.remove({name:'test'})
    2. WriteResult({ "nRemoved" : 1 })
    3. >

    删除后结果:

    1. > db.persons.find()
    2. { "_id" : ObjectId("593959250ab68d9cc7011a93"), "name" : "玉杰" }
    3. { "_id" : ObjectId("59395c350ab68d9cc7011a94"), "name" : "楚留香" }
    4. >
  8. 删除数据库——db.dropDatabase()

    查看所有数据库

    1. > show dbs
    2. demo 0.078GB
    3. foobar 0.078GB
    4. local 0.078GB
    5. myDatabase 0.078GB
    6. myTest 0.078GB
    7. >

    假设我要删除foobar数据库,先使用use foobar切换到foobar数据库,然后执行 db.dropDatabase(),执行结果如下:

    1. > db.dropDatabase()
    2. { "dropped" : "foobar", "ok" : 1 }
    3. >

    再次查看所有数据库:

    1. > show dbs
    2. demo 0.078GB
    3. local 0.078GB
    4. myDatabase 0.078GB
    5. myTest 0.078GB
    6. >
  9. Shell的help

    里面有所有的shell可以完成的命令帮助,全局的help数据库相关的db.help(),集合相关的db.[documentName].help()

    db.help()

    1. > db.help()
    2. DB methods:
    3. db.adminCommand(nameOrDocument) - switches to 'admin' db, and runs command [ just calls db.runCommand(...) ]
    4. db.auth(username, password)
    5. db.cloneDatabase(fromhost)
    6. db.commandHelp(name) returns the help for the command
    7. db.copyDatabase(fromdb, todb, fromhost)
    8. db.createCollection(name, { size : ..., capped : ..., max : ... } )
    9. db.createUser(userDocument)
    10. db.currentOp() displays currently executing operations in the db
    11. db.dropDatabase()
    12. db.eval() - deprecated
    13. db.fsyncLock() flush data to disk and lock server for backups
    14. db.fsyncUnlock() unlocks server following a db.fsyncLock()
    15. db.getCollection(cname) same as db['cname'] or db.cname
    16. db.getCollectionInfos()
    17. db.getCollectionNames()
    18. db.getLastError() - just returns the err msg string
    19. db.getLastErrorObj() - return full status object
    20. db.getLogComponents()
    21. db.getMongo() get the server connection object
    22. db.getMongo().setSlaveOk() allow queries on a replication slave server
    23. db.getName()
    24. db.getPrevError()
    25. db.getProfilingLevel() - deprecated
    26. db.getProfilingStatus() - returns if profiling is on and slow threshold
    27. db.getReplicationInfo()
    28. db.getSiblingDB(name) get the db at the same server as this one
    29. db.getWriteConcern() - returns the write concern used for any operations on this db, inherited from server object if set
    30. db.hostInfo() get details about the server's host
    31. db.isMaster() check replica primary status
    32. db.killOp(opid) kills the current operation in the db
    33. db.listCommands() lists all the db commands
    34. db.loadServerScripts() loads all the scripts in db.system.js
    35. db.logout()
    36. db.printCollectionStats()
    37. db.printReplicationInfo()
    38. db.printShardingStatus()
    39. db.printSlaveReplicationInfo()
    40. db.dropUser(username)
    41. db.repairDatabase()
    42. db.resetError()
    43. db.runCommand(cmdObj) run a database command. if cmdObj is a string, turns it into { cmdObj : 1 }
    44. db.serverStatus()
    45. db.setLogLevel(level,<component>)
    46. db.setProfilingLevel(level,<slowms>) 0=off 1=slow 2=all
    47. db.setWriteConcern( <write concern doc> ) - sets the write concern for writes to the db
    48. db.unsetWriteConcern( <write concern doc> ) - unsets the write concern for writes to the db
    49. db.setVerboseShell(flag) display extra information in shell output
    50. db.shutdownServer()
    51. db.stats()
    52. db.version() current version of the server
    53. >

    db.persons.help()

    1. > db.persons.help()
    2. DBCollection help
    3. db.persons.find().help() - show DBCursor help
    4. db.persons.count()
    5. db.persons.copyTo(newColl) - duplicates collection by copying all documents to newColl; no indexes are copied.
    6. db.persons.convertToCapped(maxBytes) - calls {convertToCapped:'persons', size:maxBytes}} command
    7. db.persons.dataSize()
    8. db.persons.distinct( key ) - e.g. db.persons.distinct( 'x' )
    9. db.persons.drop() drop the collection
    10. db.persons.dropIndex(index) - e.g. db.persons.dropIndex( "indexName" ) or db.persons.dropIndex( { "indexKey" : 1 } )
    11. db.persons.dropIndexes()
    12. db.persons.ensureIndex(keypattern[,options])
    13. db.persons.explain().help() - show explain help
    14. db.persons.reIndex()
    15. db.persons.find([query],[fields]) - query is an optional query filter. fields is optional set of fields to return.
    16. e.g. db.persons.find( {x:77} , {name:1, x:1} )
    17. db.persons.find(...).count()
    18. db.persons.find(...).limit(n)
    19. db.persons.find(...).skip(n)
    20. db.persons.find(...).sort(...)
    21. db.persons.findOne([query])
    22. db.persons.findAndModify( { update : ... , remove : bool [, query: {}, sort: {}, 'new': false] } )
    23. db.persons.getDB() get DB object associated with collection
    24. db.persons.getPlanCache() get query plan cache associated with collection
    25. db.persons.getIndexes()
    26. db.persons.group( { key : ..., initial: ..., reduce : ...[, cond: ...] } )
    27. db.persons.insert(obj)
    28. db.persons.mapReduce( mapFunction , reduceFunction , <optional params> )
    29. db.persons.aggregate( [pipeline], <optional params> ) - performs an aggregation on a collection; returns a cursor
    30. db.persons.remove(query)
    31. db.persons.renameCollection( newName , <dropTarget> ) renames the collection.
    32. db.persons.runCommand( name , <options> ) runs a db command with the given name where the first param is the collection name
    33. db.persons.save(obj)
    34. db.persons.stats({scale: N, indexDetails: true/false, indexDetailsKey: <index key>, indexDetailsName: <index name>})
    35. db.persons.storageSize() - includes free space allocated to this collection
    36. db.persons.totalIndexSize() - size in bytes of all the indexes
    37. db.persons.totalSize() - storage allocated for all data and indexes
    38. db.persons.update(query, object[, upsert_bool, multi_bool]) - instead of two flags, you can pass an object with fields: upsert, multi
    39. db.persons.validate( <full> ) - SLOW
    40. db.persons.getShardVersion() - only for use with sharding
    41. db.persons.getShardDistribution() - prints statistics about data distribution in the cluster
    42. db.persons.getSplitKeysForChunks( <maxChunkSize> ) - calculates split points over all chunks and returns splitter function
    43. db.persons.getWriteConcern() - returns the write concern used for any operations on this collection, inherited from server/db if set
    44. db.persons.setWriteConcern( <write concern doc> ) - sets the write concern for writes to the collection
    45. db.persons.unsetWriteConcern( <write concern doc> ) - unsets the write concern for writes to the collection
    46. >
  10. mongoDB的API

    http://api.mongodb.com/js/

  11. 数据库和集合命名规范

  1. 不能是空字符串
  2. 不得含有' '(空格)、,、$、/,\、和\O(空字符);
  3. 应全部小写
  4. 最多64个字节
  5. 数据库名不能与现有系统保留库同名,如admin,local,及config

数据库i命名为db-text这样的集合也是合法的,但是不能通过db.[documentName]得到了,要改为db.getCollection("documentName"),因为db-text会被当成是减。

mongoDB的shell内置javascript引擎可以直接执行js代码

  1. function insert(object){
  2. db.getCollection("db-text").insert(object)
  3. }
  4. insert({age:29})

shell可以用eval

  1. > db.eval("return 'mongodb'")
  2. WARNING: db.eval is deprecated
  3. mongodb
  4. >

BSON是JSON的扩展,他新增了诸如日期,浮点等JSON不支持的数据类型

更多命令

  1. db.AddUser(username,password) 添加用户
  2. db.auth(usrename,password) 设置数据库连接验证
  3. db.cloneDataBase(fromhost) 从目标服务器克隆一个数据库
  4. db.commandHelp(name) 返回帮助命令
  5. db.copyDatabase(fromdb,todb,fromhost) 复制数据库fromdb---源数据库名称,todb---目标数据库名称,fromhost---源数据库服务器地址
  6. db.createCollection(name,{size:3333,capped:333,max:88888}) 创建一个数据集,相当于一个表
  7. db.currentOp() 取消当前库的当前操作
  8. db.dropDataBase() 删除当前数据库
  9. db.eval(func,args) 运行服务器端代码
  10. db.getCollection(cname) 取得一个数据集合,其他类似的用法:db['cname']
  11. db.getCollenctionNames() 取得所有数据集合的名称列表
  12. db.getLastError() 返回最后一个错误的提示消息
  13. db.getLastErrorObj() 返回最后一个错误的对象
  14. db.getMongo() 取得当前服务器的连接对象
  15. db.getMongo().setSlaveOk() 允许当前连接读取备库中的成员对象
  16. db.getName() 返回当操作数据库的名称
  17. db.getPrevError() 返回上一个错误对象
  18. db.getProfilingLevel()
  19. db.getReplicationInfo() 获得重复的数据
  20. db.getSisterDB(name) 获取服务器上面的数据库
  21. db.killOp() 停止(杀死)在当前库的当前操作
  22. db.printCollectionStats() 返回当前库的数据集状态
  23. db.printReplicationInfo()
  24. db.printSlaveReplicationInfo()
  25. db.printShardingStatus() 返回当前数据库是否为共享数据库
  26. db.removeUser(username) 删除用户
  27. db.repairDatabase() 修复当前数据库
  28. db.resetError()
  29. db.runCommand(cmdObj) 运行数据库命令. 如果cmdObj string类型, 将它转换为 {cmdObj:1}格式的对象
  30. db.setProfilingLevel(level) 0=off,1=slow,2=all
  31. db.shutdownServer() 关闭当前服务程序
  32. db.version() 返回当前程序的版本信息
  33.  
  34. db.test.find({id:10}) 返回test数据集ID=10的数据集
  35. db.test.find({id:10}).count() 返回test数据集ID=10的数据总数
  36. db.test.find({id:10}).limit(2) 返回test数据集ID=10的数据集从第二条开始的数据集
  37. db.test.find({id:10}).skip(8) 返回test数据集ID=10的数据集从0到第八条的数据集
  38. db.test.find({id:10}).limit(2).skip(8) 返回test数据集ID=1=的数据集从第二条到第八条的数据
  39. db.test.find({id:10}).sort() 返回test数据集ID=10的排序数据集
  40. db.test.findOne([query]) 返回符合条件的一条数据
  41. db.test.getDB() 返回此数据集所属的数据库名称
  42. db.test.getIndexes() 返回些数据集的索引信息
  43. db.test.group({key:...,initial:...,reduce:...[,cond:...]})
  44. db.test.mapReduce(mayFunction,reduceFunction,<optional params>)
  45. db.test.remove(query) 在数据集中删除一条数据
  46. db.test.renameCollection(newName) 重命名些数据集名称
  47. db.test.save(obj) 往数据集中插入一条数据
  48. db.test.stats() 返回此数据集的状态
  49. db.test.storageSize() 返回此数据集的存储大小
  50. db.test.totalIndexSize() 返回此数据集的索引文件大小
  51. db.test.totalSize() 返回些数据集的总大小
  52. db.test.update(query,object[,upsert_bool]) 在此数据集中更新一条数据
  53. db.test.validate() 验证此数据集
  54. db.test.getShardVersion() 返回数据集共享版本号

MongoDB语法与现有关系型数据库SQL语法比较

  1. MongoDB语法 <==> MySql语法
  2. db.test.find({'name':'foobar'}) <==> select * from test where name='foobar'
  3. db.test.find() <==> select * from test
  4. db.test.find({'ID':10}).count() <==> select count(*) from test where ID=10
  5. db.test.find().skip(10).limit(20) <==> select * from test limit 10,20
  6. db.test.find({'ID':{$in:[25,35,45]}}) <==> select * from test where ID in (25,35,45)
  7. db.test.find().sort({'ID':-1}) <==> select * from test order by ID desc
  8. db.test.distinct('name',{'ID':{$lt:20}}) <==> select distinct(name) from test where ID<20
  9. db.test.group({key:{'name':true},cond:{'name':'foo'},reduce:function(obj,prev){prev.msum+=obj.marks;},initial:{msum:0}}) <==> select name,sum(marks) from test group by name
  10. db.test.find('this.ID<20',{name:1}) <==> select name from test where ID<20
  11. db.test.insert({'name':'foobar','age':25})<==>insert into test ('name','age') values('foobar',25)
  12. db.test.remove({}) <==> delete * from test
  13. db.test.remove({'age':20}) <==> delete test where age=20
  14. db.test.remove({'age':{$lt:20}}) <==> elete test where age<20
  15. db.test.remove({'age':{$lte:20}}) <==> delete test where age<=20
  16. db.test.remove({'age':{$gt:20}}) <==> delete test where age>20
  17. db.test.remove({'age':{$gte:20}}) <==> delete test where age>=20
  18. db.test.remove({'age':{$ne:20}}) <==> delete test where age!=20
  19. db.test.update({'name':'foobar'},{$set:{'age':36}}) <==> update test set age=36 where name='foobar'
  20. db.test.update({'name':'foobar'},{$inc:{'age':3}}) <==> update test set age=age+3 where name='foobar'

注意以上命令大小写敏感。

每篇半小时1天入门MongoDB——2.MongoDB环境变量配置和Shell操作的更多相关文章

  1. 每篇半小时1天入门MongoDB——1. MongoDB介绍和安装

    目录:ASP.NET MVC企业级实战目录 MongoDB简介 MongoDB是一个高性能,开源,无模式的文档型数据库,是当前NoSql数据库中比较热门的一种.它在许多场景下可用于替代传统的关系型数据 ...

  2. 每篇半小时1天入门MongoDB——3.MongoDB可视化及shell详解

    本篇主要介绍MongoDB可视化操作以及shell使用及命令,备份恢复.数据导入导出. MongoVUE安装和简单使用 使用mongo.exe 管理数据库虽然可行,功能也挺强大,但每次都要敲命令,即繁 ...

  3. 每篇半小时1天入门MongoDB——4.MongoDB索引介绍及数据库命令操作

    准备工作 继续连接到mongo C:\Users\zouqi>mongo MongoDB shell version: 3.0.7 connecting to: test 查看数据库和集合 &g ...

  4. Linux 环境变量配置(Nodejs/MongoDB/JDK/Nginx)

    一.环境变量配置 注:配置环境变量的文件 全局变量(系统级别): /etc/bashrc /etc/profile /etc/environment 用户变量(用户级别): ~/.bash_profi ...

  5. JAVA JDK 环境变量配置 入门详解 - 精简归纳

    JAVA JDK 环境变量配置 入门详解 - 精简归纳 JERRY_Z. ~ 2020 / 9 / 13 转载请注明出处!️ 目录 JAVA JDK 环境变量配置 入门详解 - 精简归纳 一.为什么j ...

  6. Python安装与环境变量配置 入门详解 - 精简归纳

    Python安装与环境变量配置 入门详解 - 精简归纳 JERRY_Z. ~ 2020 / 9 / 24 转载请注明出处!️ 目录 Python安装与环境变量配置 入门详解 - 精简归纳 一.下载Py ...

  7. GoSDK的安装及环境变量配置 入门详解 - 精简归纳

    GoSDK的安装及环境变量配置 入门详解 - 精简归纳 JERRY_Z. ~ 2020 / 10 / 29 转载请注明出处!️ 目录 GoSDK的安装及环境变量配置 入门详解 - 精简归纳 一.进入G ...

  8. smarty半小时快速上手入门教程

    http://www.jb51.net/article/56754.htm http://www.yiibai.com/smarty/smarty_functions.html http://www. ...

  9. idea部署Maven入门(一)——环境变量的配置和下载

        介绍:       1  Maven是用来管理jar包的一种工具,       2  Maven主要是构建java项目和java web项目        3 maven项目管理所依赖的jar ...

随机推荐

  1. 【转】JDBC学习笔记(4)——PreparedStatement的使用

    转自:http://www.cnblogs.com/ysw-go/ PreparedStatement public interface PreparedStatement extends State ...

  2. keil5之32环境配置

    终于配置好了!!又是经过一下午加晚上的奋战,终于把环境配置好了,多亏了我强大的资料整理能力(哈哈). 真是不容易啊,本来打算放弃的,去问问别人吧.但是想想,还是靠自己吧,靠谁都不如靠自己,真是的,慢慢 ...

  3. .NET遇上Docker - Docker集成Cron定时运行.NETCore(ConsoleApp)程序.md

    配置项目的Docker支持 对于VS中Docker的配置,依旧重复一些废话. 给项目添加Docker支持,VS2015可以直接使用Docker for VS插件,VS2017在安装时选择容器支持.VS ...

  4. JS设计模式之---单例模式

    单例模式是保证一个类仅有一个实例,并提供一个访问它的全局访问点. 单例模式在现在面向对象的语言Java,C#,C++等等中也有很多用到,其实它在Javascript中使用同样非常广泛. var Cre ...

  5. Javascript中变量作用域(2)

    多层函数调用取变量时,无论在哪里调用,要到创建此函数的作用域中取值,如果找不到再往上一级,直到全局变量. 外面定义了很多的全局的变量,下面我们来一个个理一下. 定义三个变量a,b,c;将A1函数赋值给 ...

  6. Java中的WebService服务

    一.在本地发布一个webservice服务 1.使用jdk中的 javax.xml.ws.Endpoint 类的 static Endpointpublish(Stringaddress,Object ...

  7. ELK菜鸟手记 (三) - X-Pack权限控制之给Kibana加上登录控制以及index_not_found_exception问题解决

    0. 背景 我们在使用ELK进行日志记录的时候,通过网址在Kibana中查看我们的应用程序(eg: Java Web)记录的日志, 但是默认是任何客户端都可以访问Kibana的, 这样就会造成很不安全 ...

  8. C专家编程阅读笔记

    周末闲来无事,(哗),好久之前买的C专家编程一直没看,翻起来看了一下 尽量不使用unsigned 尽量不要在代码中使用unsigned,尤其是一些看起来是无符号类型的数字,比如年龄等,因为难免要使用u ...

  9. 浅谈JavaScript时间与正则表达式

    时间函数:var box = new Date() 函数       Demo:         alert(Date.parse('4/12/2007'));    //返回的是一个毫秒数11763 ...

  10. 01背包Bone Collector

    好几天没写博客了,整天忙着打比赛,希望能有参加省赛的资格,不容易啊. 今天复习背包,之前集训讲过,现在又忘了,昨天杭电校赛刚好有一题背包,居然不会做了,好尴尬,重新复习一下. https://vjud ...