1. <var id="fe6gj"></var>

    <rp id="fe6gj"><nav id="fe6gj"></nav></rp>

    <noframes id="fe6gj"><cite id="fe6gj"></cite>

    <ins id="fe6gj"><button id="fe6gj"><p id="fe6gj"></p></button></ins>
    1. <tt id="fe6gj"><i id="fe6gj"><sub id="fe6gj"></sub></i></tt>
        始創于2000年 股票代碼:831685
        咨詢熱線:0371-60135900 注冊有禮 登錄
        • 掛牌上市企業
        • 60秒人工響應
        • 99.99%連通率
        • 7*24h人工
        • 故障100倍補償
        您的位置: 網站首頁 > 幫助中心>文章內容

        MongoDB下的查詢操作(與Java API查詢操作對應)

        發布時間:  2012/8/22 17:46:37

        相關閱讀:

        MongoDB Linux下的安裝和啟動  http://www.linuxidc.com/Linux/2011-05/36309.htm

        MongoDB下的高級查詢示例  http://www.linuxidc.com/Linux/2011-05/36312.htm
        -
         

        MongoDB Java API for 插入和單collection基本查詢使用示例 http://www.linuxidc.com/Linux/2011-05/36313.htm

        MongoDB下的查詢操作(與Java API查詢操作對應) http://www.linuxidc.com/Linux/2011-05/36314.htm

        [root@localhost ~]# mongo  
        MongoDB shell version: 1.8.1 
        connecting to: test  
        > db  
        test  
        > show collections   
        data_test  
        system.indexes  
        system.users  
        > db.system.users.find()  
        { "_id" : ObjectId("4dd73c7d247cb75e4995757b"), "user" : "iwtxokhtd", "readOnly" : false, "pwd" : "c728e00401a72282a2919648723dbff7" }  
        > db.data_test.find()  
        { "_id" : ObjectId("4dd747cb3a491e68a1a84a30"), "userId" : "10010171", "userName" : "Bill Tu1", "gender" : "m1", "interests" : { "game" : "game1", "ball" : "ball1", "other" : "nothing1" } }  
        { "_id" : ObjectId("4dd747cb3a491e68a1a84a31"), "userId" : "10010172", "userName" : "Bill Tu2", "gender" : "m2", "interests" : { "game" : "game2", "ball" : "ball2", "other" : "nothing2" } }  
        { "_id" : ObjectId("4dd747cb3a491e68a1a84a32"), "userId" : "10010173", "userName" : "Bill Tu3", "gender" : "m3", "interests" : { "game" : "game3", "ball" : "ball3", "other" : "nothing3" } }  
        { "_id" : ObjectId("4dd747cb3a491e68a1a84a33"), "userId" : "10010174", "userName" : "Bill Tu4", "gender" : "m4", "interests" : { "game" : "game4", "ball" : "ball4", "other" : "nothing4" } }  
        { "_id" : ObjectId("4dd747cb3a491e68a1a84a34"), "userId" : "10010175", "userName" : "Bill Tu5", "gender" : "m5", "interests" : { "game" : "game5", "ball" : "ball5", "other" : "nothing5" } }  
        { "_id" : ObjectId("4dd747cb3a491e68a1a84a35"), "userId" : "10010176", "userName" : "Bill Tu6", "gender" : "m6", "interests" : { "game" : "game6", "ball" : "ball6", "other" : "nothing6" } }  
        { "_id" : ObjectId("4dd747cb3a491e68a1a84a36"), "userId" : "10010177", "userName" : "Bill Tu7", "gender" : "m7", "interests" : { "game" : "game7", "ball" : "ball7", "other" : "nothing7" } }  
        { "_id" : ObjectId("4dd747cb3a491e68a1a84a37"), "userId" : "10010178", "userName" : "Bill Tu8", "gender" : "m8", "interests" : { "game" : "game8", "ball" : "ball8", "other" : "nothing8" } }  
        { "_id" : ObjectId("4dd747cb3a491e68a1a84a38"), "userId" : "10010179", "userName" : "Bill Tu9", "gender" : "m9", "interests" : { "game" : "game9", "ball" : "ball9", "other" : "nothing9" } }  
        { "_id" : ObjectId("4dd747cb3a491e68a1a84a39"), "userId" : "100101710", "userName" : "Bill Tu10", "gender" : "m10", "interests" : { "game" : "game10", "ball" : "ball10", "other" : "nothing10" } }  
        > db.data_test.findOne()  
        {  
                "_id" : ObjectId("4dd747cb3a491e68a1a84a30"),  
                "userId" : "10010171",  
                "userName" : "Bill Tu1",  
                "gender" : "m1",  
                "interests" : {  
                        "game" : "game1",  
                        "ball" : "ball1",  
                        "other" : "nothing1" 
                }  
        }  
        > db.data_test.find({"userId":"10010171"})  
        { "_id" : ObjectId("4dd747cb3a491e68a1a84a30"), "userId" : "10010171", "userName" : "Bill Tu1", "gender" : "m1", "interests" : { "game" : "game1", "ball" : "ball1", "other" : "nothing1" } }  
        > db.data_test.find({"userId":"10010171","userName":"Bill Tu1"})  
        { "_id" : ObjectId("4dd747cb3a491e68a1a84a30"), "userId" : "10010171", "userName" : "Bill Tu1", "gender" : "m1", "interests" : { "game" : "game1", "ball" : "ball1", "other" : "nothing1" } }  
        > db.data_test.find({"userId":{$in:["10010171","10010172"]}})  
        { "_id" : ObjectId("4dd747cb3a491e68a1a84a30"), "userId" : "10010171", "userName" : "Bill Tu1", "gender" : "m1", "interests" : { "game" : "game1", "ball" : "ball1", "other" : "nothing1" } }  
        { "_id" : ObjectId("4dd747cb3a491e68a1a84a31"), "userId" : "10010172", "userName" : "Bill Tu2", "gender" : "m2", "interests" : { "game" : "game2", "ball" : "ball2", "other" : "nothing2" } }  
        > db.data_test.find({"userId":/10010171.*/i})  
        { "_id" : ObjectId("4dd747cb3a491e68a1a84a30"), "userId" : "10010171", "userName" : "Bill Tu1", "gender" : "m1", "interests" : { "game" : "game1", "ball" : "ball1", "other" : "nothing1" } }  
        { "_id" : ObjectId("4dd747cb3a491e68a1a84a39"), "userId" : "100101710", "userName" : "Bill Tu10", "gender" : "m10", "interests" : { "game" : "game10", "ball" : "ball10", "other" : "nothing10" } }  
        >  


        本文出自:億恩科技【www.endtimedelusion.com】

        服務器租用/服務器托管中國五強!虛擬主機域名注冊頂級提供商!15年品質保障!--億恩科技[ENKJ.COM]

      1. 您可能在找
      2. 億恩北京公司:
      3. 經營性ICP/ISP證:京B2-20150015
      4. 億恩鄭州公司:
      5. 經營性ICP/ISP/IDC證:豫B1.B2-20060070
      6. 億恩南昌公司:
      7. 經營性ICP/ISP證:贛B2-20080012
      8. 服務器/云主機 24小時售后服務電話:0371-60135900
      9. 虛擬主機/智能建站 24小時售后服務電話:0371-60135900
      10. 專注服務器托管17年
        掃掃關注-微信公眾號
        0371-60135900
        Copyright© 1999-2019 ENKJ All Rights Reserved 億恩科技 版權所有  地址:鄭州市高新區翠竹街1號總部企業基地億恩大廈  法律顧問:河南亞太人律師事務所郝建鋒、杜慧月律師   京公網安備41019702002023號
          0
         
         
         
         

        0371-60135900
        7*24小時客服服務熱線

         
         
        av不卡不卡在线观看_最近2018年中文字幕_亚洲欧美一区二区三区_一级A爱做片免费观看国产_日韩在线中文天天更新_伊人中文无码在线