MongoDB入门教程:从零开始学习

需积分: 10 21 下载量 107 浏览量 更新于2024-07-20 1 收藏 2.12MB PDF 举报
"MongoDB菜鸟初入门-91页超清" MongoDB是一个开源、高性能、无模式的文档型数据库,属于NoSQL数据库的一种。这本书籍《MongoDB菜鸟初入门》由王文龙编著,旨在帮助初学者了解并掌握MongoDB的基础知识和实践操作。 在NoSQL领域,MongoDB因其灵活性、可扩展性和高可用性而受到广泛应用。书中提到,NoSQL(Not Only SQL)是对非关系型数据库的统称,它的出现主要针对大数据、高并发、实时分析等场景,与传统的SQL数据库相比,NoSQL具有以下特点:分布式存储、水平扩展、数据模型灵活等。 MongoDB的特点包括文档导向、支持丰富的查询表达式、动态Schema、自动分片等。它以JSON-like的BSON格式存储数据,这种格式易于读写且体积小。MongoDB适用于需要处理大量结构化但不完全符合传统表模型的数据,如Web应用、物联网数据、日志分析等。 在安装和配置方面,书中介绍了Windows和Linux两个平台的安装方法。Windows用户可以通过下载安装包进行安装,而Linux用户则需要通过包管理器或者下载源码编译安装。配置方面,涉及启动、停止数据库的不同方式,以及 mongod 命令行工具的参数设置。 MongoDB的体系结构包括数据逻辑结构和数据存储结构。数据逻辑结构是基于集合(Collections)和文档(Documents)的概念,而数据存储结构涉及到数据如何在硬盘上组织,包括WiredTiger存储引擎的使用。 快速入门章节涵盖了MongoDB的基本操作,如启动和停止数据库,包括命令行方式、配置文件方式以及Daemon方式。连接数据库使用mongo shell,插入记录时会介绍到默认的主键 `_id`。查询记录分为普通查询和条件查询,如使用find()和findOne()函数。修改记录可以使用update(),删除记录使用remove()。此外,书中还提到了一些常用的管理工具,如MongoVUE和RockMongo,这些都是图形化界面工具,方便用户直观地管理和操作MongoDB数据库。 《MongoDB菜鸟初入门》是一本适合初学者的教程,通过这本书,读者可以全面了解MongoDB的基础概念、安装步骤和基本操作,为进一步深入学习和使用MongoDB打下坚实基础。

为什么会这样[user_mongo@nosql01 replicaset]$ cd /opt [user_mongo@nosql01 opt]$ ll total 0 drwxr-xr-x. 3 root root 25 Mar 16 17:08 servers drwxr-xr-x. 2 root root 51 Mar 16 17:10 software [user_mongo@nosql01 opt]$ tar -zxvf /opt/software/mongodb-linux-x86_64-rhel70-4.4.12.tgz -C /opt/servers/mongodb_demo/replicaset/ mongodb-linux-x86_64-rhel70-4.4.12/LICENSE-Community.txt tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/LICENSE-Community.txt: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/MPL-2 tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/MPL-2: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/README tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/README: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/THIRD-PARTY-NOTICES tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/THIRD-PARTY-NOTICES: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/bin/install_compass tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/bin/install_compass: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/bin/mongo tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/bin/mongo: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/bin/mongod tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/bin/mongod: Cannot open: No such file or directory mongodb-linux-x86_64-rhel70-4.4.12/bin/mongos tar: mongodb-linux-x86_64-rhel70-4.4.12: Cannot mkdir: Permission denied tar: mongodb-linux-x86_64-rhel70-4.4.12/bin/mongos: Cannot open: No such file or directory tar: Exiting with failure status due to previous errors [user_mongo@nosql01 opt]$ tar -zcvf /opt/software/mongodb-linux-x86_64-rhel70-4.4.12.tgz -C /opt/servers/mongodb_demo/replicaset/ tar: Cowardly refusing to create an empty archive Try `tar --help' or `tar --usage' for more information.

2023-06-01 上传