欧美一级特黄大片做受成人-亚洲成人一区二区电影-激情熟女一区二区三区-日韩专区欧美专区国产专区

6.mongo命令提示符幫助-創(chuàng)新互聯(lián)

6.mongo命令提示符幫助

最新內(nèi)容會(huì)在源站更新.轉(zhuǎn)載請(qǐng)保留原文鏈接: http://dashidan.com/article/mongodb/index.html

定陶ssl適用于網(wǎng)站、小程序/APP、API接口等需要進(jìn)行數(shù)據(jù)傳輸應(yīng)用場(chǎng)景,ssl證書(shū)未來(lái)市場(chǎng)廣闊!成為創(chuàng)新互聯(lián)公司的ssl證書(shū)銷(xiāo)售渠道,可以享受市場(chǎng)價(jià)格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:18982081108(備注:SSL證書(shū)合作)期待與您的合作!

① mongo命令行參數(shù)幫助

通過(guò)--help參數(shù)顯示命令行幫助信息

mongo --help

顯示:

MongoDB shell version: 2.0.4usage: mongo [options] [db address] [file names (ending in .js)]db address can be:   foo                   foo database on local machine  192.169.0.5/foo       foo database on 192.168.0.5 machine  192.169.0.5:9999/foo  foo database on 192.168.0.5 machine on port 9999options:   --shell               run the shell after executing files  --nodb                don't connect to mongod on startup - no 'db address'                         arg expected   --norc                開(kāi)始不執(zhí)行".mongorc.js"文件   --quiet               安靜模式   --port arg            端口   --host arg            IP   --eval arg            運(yùn)行javascript腳本   -u [ --username ] arg 用戶名   -p [ --password ] arg 密碼   -h [ --help ]         顯示這個(gè)幫助信息   --version             版本號(hào)   --verbose             increase verbosity   --ipv6                開(kāi)啟IPv6支持(默認(rèn)關(guān)閉)

② mongo指令幫助

通過(guò)命令提示符連上mongo數(shù)據(jù)庫(kù)后,可以輸入help來(lái)顯示命令提示符幫助.

help

會(huì)顯示:

db.help()                    數(shù)據(jù)庫(kù)方法幫助信息db.mycoll.help()             集合方法幫助信息rs.help()                    help on replica set methods help admin                   管理員幫助信息help connect                 連接數(shù)據(jù)庫(kù)幫助help keys                    快捷鍵help misc                    雜項(xiàng)信息幫助help mr                      mapreduce幫助show dbs                     顯示全部數(shù)據(jù)庫(kù)名show collections             顯示當(dāng)前數(shù)據(jù)庫(kù)中的全部集合名show users                   顯示當(dāng)前數(shù)據(jù)庫(kù)的全部用戶show profile                 show most recent system.profile entries with time >= 1msshow logs                    顯示可以連接的日志(`logger`)名show log [name]              輸出內(nèi)存中的最近log的片段, 默認(rèn)輸出`global`use <db_name>                設(shè)定當(dāng)前數(shù)據(jù)庫(kù)db.foo.find()                顯示集合`foo`中的對(duì)象列表db.foo.find( { a : 1 } )     查詢foo集合中`a == 1`的對(duì)象it                           輸入it, 繼續(xù)迭代顯示結(jié)果, 輸出更多結(jié)果DBQuery.shellBatchSize = x   設(shè)置顯示結(jié)果條數(shù)exit                         退出命令行

③ 數(shù)據(jù)庫(kù)幫助

1.顯示全部數(shù)據(jù)庫(kù)

show dbs

2.顯示部數(shù)據(jù)操作幫助

db.help()

3.顯示方法的實(shí)現(xiàn)

顯示一個(gè)數(shù)據(jù)的方法的具體實(shí)現(xiàn),輸入db.<method name>不帶(). 例如:

db.updateUser

顯示:

test.updateUser

④ 集合幫助

1.顯示全部集合

show collections

2.顯示集合幫助

db.collection.help()

顯示

db.collection.find().help() - show DBCursor help db.collection.count()db.collection.dataSize()db.collection.distinct( key ) - eg. db.collection.distinct( 'x' )db.collection.drop() drop the collection db.collection.dropIndex(name)db.collection.dropIndexes()db.collection.ensureIndex(keypattern[,options]) - options is an object with these possible fields: name, unique, dropDups db.collection.reIndex()db.collection.find([query],[fields]) - query is an optional query filter. fields is optional set of fields to return.                                               e.g. db.collection.find( {x:77} , {name:1, x:1} )db.collection.find(...).count()db.collection.find(...).limit(n)db.collection.find(...).skip(n)db.collection.find(...).sort(...)db.collection.findOne([query])db.collection.findAndModify( { update : ... , remove : bool [, query: {}, sort: {}, 'new': false] } )db.collection.getDB() get DB object associated with collection db.collection.getIndexes()db.collection.group( { key : ..., initial: ..., reduce : ...[, cond: ...] } )db.collection.mapReduce( mapFunction , reduceFunction , <optional params> )db.collection.remove(query)db.collection.renameCollection( newName , <dropTarget> ) renames the collection.db.collection.runCommand( name , <options> ) runs a db command with the given name where the first param is the collection name db.collection.save(obj)db.collection.stats()db.collection.storageSize() - includes free space allocated to this collection db.collection.totalIndexSize() - size in bytes of all the indexes db.collection.totalSize() - storage allocated for all data and indexes db.collection.update(query, object[, upsert_bool, multi_bool])db.collection.validate( <full> ) - SLOW db.collection.getShardVersion() - only for use with sharding db.collection.getShardDistribution() - prints statistics about data distribution in the cluster

3.顯示集合方法實(shí)現(xiàn)

顯示方法實(shí)現(xiàn)輸入db.<collection>.<method>, 不帶(). 例如輸入:

db.collection.save

顯示:

function (obj) {     if (obj == null || typeof obj == "undefined") {         throw "can't save a null";     }     if (typeof obj == "number" || typeof obj == "string") {         throw "can't save a number or string";     }     if (typeof obj._id == "undefined") {         obj._id = new ObjectId;         return this.insert(obj);     } else {         return this.update({_id:obj._id}, obj, true);     }}

⑤ cursor幫助

當(dāng)你在mongo命令行使用find()方法時(shí), 可以使用很多cursor方法來(lái)修改find()行為和結(jié)果.

  • 顯示find()方法可用的修改器和cursor處理方法

    db.collection.find().help()

顯示:

> db.collection.find().help()find() modifiers    .sort( {...} )     .limit( n )     .skip( n )     .count() - total # of objects matching query, ignores skip,limit     .size() - total # of objects cursor would return, honors skip,limit     .explain([verbose])     .hint(...)     .showDiskLoc() - adds a $diskLoc field to each returned objectCursor methods    .forEach( func )     .map( func )     .hasNext()     .next()
  • cursor方法的實(shí)現(xiàn), 輸入db.<collection>.find().<method>, 不包含(). 例如:

db.collection.find().toArray

顯示:

> db.collection.find().toArrayfunction () {     if (this._arr) {         return this._arr;     }     var a = [];     while (this.hasNext()) {         a.push(this.next());     }     this._arr = a;     return a;}

常用的cursor方法

  • hasNext() 查詢cursor是否還有數(shù)據(jù).

  • next() 返回下一個(gè)數(shù)據(jù)對(duì)象, 并且cursor指向位置加1.

  • forEach(

    ) 方法遍歷執(zhí)行全部結(jié)果. 只有1參數(shù), 迭代器中指向的對(duì)象.

⑥ 包裝對(duì)象幫助

可以通過(guò)輸入help misc來(lái)獲取對(duì)象包裝類(lèi).

help misc

顯示:

> help misc     b = new BinData(subtype,base64str)  create a BSON BinData value     b.subtype()                         the BinData subtype (0..255)     b.length()                          length of the BinData data in bytes     b.hex()                             the data as a hex encoded string     b.base64()                          the data as a base 64 encoded string     b.toString()     b = HexData(subtype,hexstr)         create a BSON BinData value from a hex string     b = UUID(hexstr)                    create a BSON BinData value of UUID subtype     b = MD5(hexstr)                     create a BSON BinData value of MD5 subtype     o = new ObjectId()                  create a new ObjectId     o.getTimestamp()                    return timestamp derived from first 32 bits of the OID     o.isObjectId()     o.toString()     o.equals(otherid)

⑦ 參考文章

 官方文檔

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無(wú)理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國(guó)服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡(jiǎn)單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專(zhuān)為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。

分享名稱(chēng):6.mongo命令提示符幫助-創(chuàng)新互聯(lián)
本文來(lái)源:http://www.aaarwkj.com/article12/cchcdc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供Google、軟件開(kāi)發(fā)網(wǎng)站排名、品牌網(wǎng)站制作網(wǎng)站內(nèi)鏈、商城網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站建設(shè)
两性色午夜视频在线观看| 久久久久亚洲av成人网人| 蜜臀人妻四季av一区二区不卡| av天堂资源地址在线观看| 播放欧美日韩特黄大片| 免费人妻一区二区三区| 91麻豆精品在线观看| 一区三区精品久久久精品| 欧美黄片视频在线免费看| 日韩精品在线观看一| 久久草福利视频在线观看| 成人深夜免费观看视频| 成人性生交大片免费看多人| 九九热精品视频美谷朱里| 少妇高潮一区二区三区在线| 日本成人高清一区二区| av影片在线观看不卡| 日本高清免费中文字幕| 97精品国产高清在线| 中文字幕人妻日韩在线| 国产真实老熟女无套内| 熟女人妻视频一区二区| 日日躁夜夜躁久久狠狠躁| 三级视频一区二区三区| 欧美香蕉视频播放二区| 欧美日韩精品亚洲成人精品| 18岁禁看网站在线看| 亚洲国产精品一区二区av不卡| 风间由美亚洲一区二区三区| av毛片在线观看地址| 免费观看亚洲成人av| 成年人性生活一级视品| 欧美日韩国产综合一区二区| 国产黄色av网站在线| 亚洲av精二区三区四区| 精品欧美激情精品一区| 欧美一区二区日韩一区二区| 91在线视频国产网站| av成人黄色片在线播放| 每日更新中文字幕粉嫩av| 亚洲精品一区二区成人影院|