广告
返回顶部
首页 > 资讯 > 数据库 >How to connect to mongodb on centos7
  • 788
分享到

How to connect to mongodb on centos7

Howtoconnecttomongodboncentos7 2014-05-19 00:05:34 788人浏览 猪猪侠
摘要

sample [lwk@qwfys:~]$ mongo -u lanzhou mongodb://vm88.lan/lanzhou MongoDB shell version v4.2.8 Enter password: connecti

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                 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
> 


您可能感兴趣的文档:

--结束END--

本文标题: How to connect to mongodb on centos7

本文链接: https://www.lsjlt.com/news/7274.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作