2013-12-13

3306 단어
<!--&#십삼;
h1,h2,h3,h4,h5,h6,p,blockquote { margin: 0; padding: 0;}body { font-family: "Helvetica Neue", Helvetica, "Hiragino Sans GB", Arial, sans-serif; font-size: 13px; line-height: 18px; color: #737373; margin: 10px 13px 10px 13px;}a { color: #0069d6;}a:hover { color: #0050a3; text-decoration: none;}a img { border: none;}p { margin-bottom: 9px;}h1,h2,h3,h4,h5,h6 { color: #404040; line-height: 36px;}h1 { margin-bottom: 18px; font-size: 30px;}h2 { font-size: 24px;}h3 { font-size: 18px;}h4 { font-size: 16px;}h5 { font-size: 14px;}h6 { font-size: 13px;}hr { margin: 0 0 19px; border: 0; border-bottom: 1px solid #ccc;}blockquote { padding: 13px 13px 21px 15px; margin-bottom: 18px; font-family:georgia,serif; font-style: italic;}blockquote:before { content:"C"; font-size:40px; margin-left:-10px; font-family:georgia,serif; color:#eee;}blockquote p { font-size: 14px; font-weight: 300; line-height: 18px; margin-bottom: 0; font-style: italic;}code, pre { font-family: Monaco, Andale Mono, Courier New, monospace;}code { background-color: #fee9cc; color: rgba(0, 0, 0, 0.75); padding: 1px 3px; font-size: 12px; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px;}pre { display: block; padding: 14px; margin: 0 0 18px; line-height: 16px; font-size: 11px; border: 1px solid #d9d9d9; white-space: pre-wrap; word-wrap: break-word;}pre code { background-color: #fff; color:#737373; font-size: 11px; padding: 0;}@media screen and (min-width: 768px) { body { width: 748px; margin:10px auto; }}&#십삼;
-->

Mongodb 액세스 제어


* 1.IP 네트워킹 주소 액세스를 바인딩합니다.

    mongod.exe --bind_ip 192.168.20.16
     , ip
    mongo.exe 192.168.20.111

* 2.감청 포트

     port 27017, ip:
mongod.exe --bing_ip 192.168.20.13 -port 28008
     port,  

프로세스 제어


* 1.db.currentOp() 활성 프로세스 보기

 :{inprog:[]}
 :
        {inprog:[{"opid":18,"op":"qurey","ns","blog.user",
                    "query":"{user:jack}","inLock":1}
            ]
            }
         opid: 
         op: 
         ns: 
         query: 
         inLock: . 

* 2.프로세스 종료

    db.killOp(1234) 1234:opid

색인


1 기본 색인

    db.collection_name.ensureIndex({age:1})   ,1 ,-1 

    db.collection_name.etIndexs()    

     :db.name.ensureIndex({age:1},{background:true})

2. 인덱스 조합

    db.name.insert({name:'www',addr:{city:"beijing",state:"ff"}})
    db.name.ensureIndex({"age":1,"addr.city":-1})

     :
        db.name.find({age:{$gt:30}}).hint({name:1,age:1})  

     :
        db.name.dropIndexs()   
        db.name.dropIndex({age:1})  

좋은 웹페이지 즐겨찾기