How to connect to mongodb on centos7[亲测有效]

How to connect to mongodb on centos7[亲测有效]sample [lwk@qwfys:~]$ mongo -u lanzhou mongodb://vm88.lan/lanzhou MongoDB shell version v4.2.8 Ente…

How to connect to mongodb on centos7

sample

[lwk@qwfys:~]$ mongo -u lanzhou mongodb://vm88.lan/lanzhou
MongoDB shell version v4.2.8
Enter password: 
connecting to: mongodb://vm88.lan:27017/lanzhou?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("491fae27-1060-48ec-b156-69fe9c27d117") }
MongoDB server version: 4.2.8
> help
        db.help()                    help on db methods
        db.mycoll.help()             help on collection methods
        sh.help()                    sharding helpers
        rs.help()                    replica set helpers
        help admin                   administrative help
        help connect                 connecting to a db help
        help keys                    key shortcuts
        help misc                    misc things to know
        help mr                      mapreduce

        show dbs                     show database names
        show collections             show collections in current database
        show users                   show users in current database
        show profile                 show most recent system.profile entries with time >= 1ms
        show logs                    show the accessible logger names
        show log [name]              prints out the last segment of log in memory, "global" is default
        use <db_name>                set current database
        db.foo.find()                list objects in collection foo
        db.foo.find( { a : 1 } )     list objects in foo where a == 1
        it                           result of the last line evaluated; use to further iterate
        DBQuery.shellBatchSize = x   set default number of items to display on shell
        exit                         quit the mongo shell
> show collections
artists
inventory
musicians
producers
userDomain
> 


代码100分

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
转载请注明出处: https://daima100.com/7308.html

(0)
上一篇 2023-03-22
下一篇 2023-03-22

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注