Hướng dẫn what is the name of default database in mongodb? - tên của cơ sở dữ liệu mặc định trong mongodb là gì?
All of you must know about its internal database of MongoDB i.e. default database of MongoDB. If you are a MongoDB user you should know, what all are the default database in MongoDB or you can say the internal default database in MongoDB. Show
1. Tổng quan về cơ sở dữ liệu mặc định trong MongoDBCơ sở dữ liệu trong MongoDB là một tập hợp các bộ sưu tập trong MongoDB. Nếu bạn muốn biết thêm về bộ sưu tập ở MongoDB, bạn có thể truy cập bài viết khác của tôi là gì trong bộ sưu tập trong MongoDB ?. Có 2 bộ cơ sở dữ liệu trong nút của thể hiện MongoDB,
2. Làm thế nào để có được danh sách cơ sở dữ liệu?Sau đây là lệnh Mongoshell để có được danh sách cơ sở dữ liệu được tạo trong MongoDB cho nút, từ đó bạn đã kết nối. show dbs; Đầu ra của bảng điều khiển như: > show dbs; admin 0.000GB config 0.000GB local 0.000GB > Khi bạn nhập lệnh > show dbs; admin 0.000GB config 0.000GB local 0.000GB >0, vì vậy bạn cũng có thể hợp tác và nhớ, nếu bạn biết những điều cơ bản của MySQL. 3. Cơ sở dữ liệu nội bộ: Cơ sở dữ liệu cục bộTrong MongoDB, có một cơ sở dữ liệu cục bộ là cơ sở dữ liệu dành riêng được sử dụng để lưu trữ siêu dữ liệu của quy trình sao chép và dữ liệu liên quan khác. Cơ sở dữ liệu cục bộ này không phải là một phần của cơ sở dữ liệu sao chép, có nghĩa là, bộ sưu tập trong cơ sở dữ liệu > show dbs; admin 0.000GB config 0.000GB local 0.000GB >1 sẽ không sao chép từ nút chính của MongoDB sang nút thứ cấp của MongoDB. Khi khởi động, mỗi trường hợp > show dbs; admin 0.000GB config 0.000GB local 0.000GB >2, động cơ MongoDB chèn một tài liệu vào cơ sở dữ liệu > show dbs; admin 0.000GB config 0.000GB local 0.000GB >3 của > show dbs; admin 0.000GB config 0.000GB local 0.000GB >1 và thông tin này sẽ hữu ích cho mục đích diagostic. Bộ sưu tập > show dbs; admin 0.000GB config 0.000GB local 0.000GB >3 là một bộ sưu tập giới hạn. Thông tin được lưu trữ trong bộ sưu tập > show dbs; admin 0.000GB config 0.000GB local 0.000GB >1 sẽ hữu ích tại thời điểm bạn thực hiện Diagonstic chính. Chúng tôi có thể làm Readwrite trên bộ sưu tập > show dbs; admin 0.000GB config 0.000GB local 0.000GB >3 này. > use local switched to db local > show collections startup_log > db.startup_log.find().pretty(); { "_id" : "DESKTOP-AJRAAJK-1607882562522", "hostname" : "DESKTOP-AJRAAJK", "startTime" : ISODate("2020-12-13T18:02:42Z"), "startTimeLocal" : "Sun Dec 13 23:32:42.522", "cmdLine" : { "config" : "C:\\Program Files\\MongoDB\\Server\\4.4\\bin\\mongod.cfg", "net" : { "bindIp" : "127.0.0.1", "port" : 27017 }, "service": true, "storage" : { "dbPath" : "C:\\Program Files\\MongoDB\\Server\\4.4\\data", "journal" : { "enabled" : true } }, "systemLog" : { "destination" : "file", "logAppend" : true, "path" : "C:\\Program Files\\MongoDB\\Server\\4.4\\log\\mongod.log" } }, "pid" : NumberLong(8700), "buildinfo" : { "version" : "4.4.2", "gitVersion" : "15e73dc5738d2278b688f8929aee605fe4279b0e", "targetMinOS" : "Windows 7/Windows Server 2008 R2", "modules" : [ ], "allocator" : "tcmalloc", "javascriptEngine" : "mozjs", "sysInfo" : "deprecated", "versionArray" : [ 4, 4, 2, 0 ], "openssl" : { "running" : "Windows SChannel" }, "buildEnvironment" : { "distmod" : "windows", "distarch" : "x86_64", "cc" : "cl: Microsoft (R) C/C++ Optimizing Compiler Version 19.26.28806 for x64", "ccflags" : "/nologo /EHsc /W3 /wd4068 /wd4244 /wd4267 /wd4290 /wd4351 /wd4355 /wd4373 /wd4800 /wd5041 /wd4291 /we4013 /we4099 /we4930 /WX /errorReport:none /MD /O2 /Oy- /bigobj /utf-8 /permissive- /Zc:__cplusplus /Zc:sizedDealloc /volatile:iso /diagnostics:caret /std:c++17 /Gw /Gy /Zc:inline", "cxx" : "cl: Microsoft (R) C/C++ Optimizing Compiler Version 19.26.28806 for x64", "cxxflags" : "/TP", "linkflags" : "/nologo /DEBUG /INCREMENTAL:NO /LARGEADDRESSAWARE /OPT:REF", "target_arch" : "x86_64", "target_os" : "windows", "cppdefines" : "SAFEINT_USE_INTRINSICS 0 PCRE_STATIC NDEBUG BOOST_ALL_NO_LIB _UNICODE UNICODE _SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING _CONSOLE _CRT_SECURE_NO_WARNINGS _SCL_SECURE_NO_WARNINGS _WIN32_WINNT 0x0A00 BOOST_USE_WINAPI_VERSION 0x0A00 NTDDI_VERSION 0x0A000000 BOOST_THREAD_VERSION 5 BOOST_THREAD_USES_DATETIME BOOST_SYSTEM_NO_DEPRECATED BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS BOOST_ENABLE_ASSERT_DEBUG_HANDLER BOOST_LOG_NO_SHORTHAND_NAMES BOOST_LOG_USE_NATIVE_SYSLOG BOOST_LOG_WITHOUT_THREAD_ATTR ABSL_FORCE_ALIGNED_ACCESS" }, "bits" : 64, "debug" : false, "maxBsonObjectSize" : 16777216, "storageEngines" : [ "biggie", "devnull", "ephemeralForTest", "wiredTiger" ] } } > 4. Cơ sở dữ liệu quản trị bằng MongoDBCơ sở dữ liệu > show dbs; admin 0.000GB config 0.000GB local 0.000GB >8 đóng vai trò quan trọng trong việc xác thực và ủy quyền cho người dùng cơ sở dữ liệu MongoDB. Và cơ sở dữ liệu > show dbs; admin 0.000GB config 0.000GB local 0.000GB >8 này cũng được sử dụng cho mục đích hành chính. Có các cơ chế bảo mật khác nhau để cho phép bảo mật trong MongoDB. Nếu bạn đã kích hoạt bảo mật trong MongoDB để xác thực và ủy quyền cho người dùng cơ sở dữ liệu MongoDB thì > show dbs; admin 0.000GB config 0.000GB local 0.000GB >8 dB này sẽ vào hình ảnh. Cho phép xác thực và ủy quyền là tùy chọn, tuy nhiên, nó luôn luôn khuyến nghị cho phép xác thực người dùng cơ sở dữ liệu để thiết lập kết nối từ khách hàng của bạn trong môi trường sản xuất, đó có thể là ứng dụng của bạn, ứng dụng khách hàng của bạn, tức là Robomongo. There are different security mechanisms to enable security in MongoDB. If you have enabled security in MongoDB for authentication and authorization of MongoDB database user then this > show dbs; admin 0.000GB config 0.000GB local 0.000GB >8 db comes into the picture. Enabling authentication and authorization is optional, however, it’s always recommended to enable for authentication of database users for establishing a connection from your client in the production environment, it could be your application, your client app i.e. RoboMongo. > use admin switched to db admin > show collections system.version > db.system.version.find(); { "_id" : "featureCompatibilityVersion", "version" : "4.4" } > 5. Cấu hình cơ sở dữ liệu trong MongoDBCơ sở dữ liệu MongoDB > use local switched to db local > show collections startup_log > db.startup_log.find().pretty(); { "_id" : "DESKTOP-AJRAAJK-1607882562522", "hostname" : "DESKTOP-AJRAAJK", "startTime" : ISODate("2020-12-13T18:02:42Z"), "startTimeLocal" : "Sun Dec 13 23:32:42.522", "cmdLine" : { "config" : "C:\\Program Files\\MongoDB\\Server\\4.4\\bin\\mongod.cfg", "net" : { "bindIp" : "127.0.0.1", "port" : 27017 }, "service": true, "storage" : { "dbPath" : "C:\\Program Files\\MongoDB\\Server\\4.4\\data", "journal" : { "enabled" : true } }, "systemLog" : { "destination" : "file", "logAppend" : true, "path" : "C:\\Program Files\\MongoDB\\Server\\4.4\\log\\mongod.log" } }, "pid" : NumberLong(8700), "buildinfo" : { "version" : "4.4.2", "gitVersion" : "15e73dc5738d2278b688f8929aee605fe4279b0e", "targetMinOS" : "Windows 7/Windows Server 2008 R2", "modules" : [ ], "allocator" : "tcmalloc", "javascriptEngine" : "mozjs", "sysInfo" : "deprecated", "versionArray" : [ 4, 4, 2, 0 ], "openssl" : { "running" : "Windows SChannel" }, "buildEnvironment" : { "distmod" : "windows", "distarch" : "x86_64", "cc" : "cl: Microsoft (R) C/C++ Optimizing Compiler Version 19.26.28806 for x64", "ccflags" : "/nologo /EHsc /W3 /wd4068 /wd4244 /wd4267 /wd4290 /wd4351 /wd4355 /wd4373 /wd4800 /wd5041 /wd4291 /we4013 /we4099 /we4930 /WX /errorReport:none /MD /O2 /Oy- /bigobj /utf-8 /permissive- /Zc:__cplusplus /Zc:sizedDealloc /volatile:iso /diagnostics:caret /std:c++17 /Gw /Gy /Zc:inline", "cxx" : "cl: Microsoft (R) C/C++ Optimizing Compiler Version 19.26.28806 for x64", "cxxflags" : "/TP", "linkflags" : "/nologo /DEBUG /INCREMENTAL:NO /LARGEADDRESSAWARE /OPT:REF", "target_arch" : "x86_64", "target_os" : "windows", "cppdefines" : "SAFEINT_USE_INTRINSICS 0 PCRE_STATIC NDEBUG BOOST_ALL_NO_LIB _UNICODE UNICODE _SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING _CONSOLE _CRT_SECURE_NO_WARNINGS _SCL_SECURE_NO_WARNINGS _WIN32_WINNT 0x0A00 BOOST_USE_WINAPI_VERSION 0x0A00 NTDDI_VERSION 0x0A000000 BOOST_THREAD_VERSION 5 BOOST_THREAD_USES_DATETIME BOOST_SYSTEM_NO_DEPRECATED BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS BOOST_ENABLE_ASSERT_DEBUG_HANDLER BOOST_LOG_NO_SHORTHAND_NAMES BOOST_LOG_USE_NATIVE_SYSLOG BOOST_LOG_WITHOUT_THREAD_ATTR ABSL_FORCE_ALIGNED_ACCESS" }, "bits" : 64, "debug" : false, "maxBsonObjectSize" : 16777216, "storageEngines" : [ "biggie", "devnull", "ephemeralForTest", "wiredTiger" ] } } >1 được sử dụng để lưu trữ thông tin liên quan đến Sharding và siêu dữ liệu của nó. Nếu bạn có một máy chủ MongoDB độc lập thì cơ sở dữ liệu > use local switched to db local > show collections startup_log > db.startup_log.find().pretty(); { "_id" : "DESKTOP-AJRAAJK-1607882562522", "hostname" : "DESKTOP-AJRAAJK", "startTime" : ISODate("2020-12-13T18:02:42Z"), "startTimeLocal" : "Sun Dec 13 23:32:42.522", "cmdLine" : { "config" : "C:\\Program Files\\MongoDB\\Server\\4.4\\bin\\mongod.cfg", "net" : { "bindIp" : "127.0.0.1", "port" : 27017 }, "service": true, "storage" : { "dbPath" : "C:\\Program Files\\MongoDB\\Server\\4.4\\data", "journal" : { "enabled" : true } }, "systemLog" : { "destination" : "file", "logAppend" : true, "path" : "C:\\Program Files\\MongoDB\\Server\\4.4\\log\\mongod.log" } }, "pid" : NumberLong(8700), "buildinfo" : { "version" : "4.4.2", "gitVersion" : "15e73dc5738d2278b688f8929aee605fe4279b0e", "targetMinOS" : "Windows 7/Windows Server 2008 R2", "modules" : [ ], "allocator" : "tcmalloc", "javascriptEngine" : "mozjs", "sysInfo" : "deprecated", "versionArray" : [ 4, 4, 2, 0 ], "openssl" : { "running" : "Windows SChannel" }, "buildEnvironment" : { "distmod" : "windows", "distarch" : "x86_64", "cc" : "cl: Microsoft (R) C/C++ Optimizing Compiler Version 19.26.28806 for x64", "ccflags" : "/nologo /EHsc /W3 /wd4068 /wd4244 /wd4267 /wd4290 /wd4351 /wd4355 /wd4373 /wd4800 /wd5041 /wd4291 /we4013 /we4099 /we4930 /WX /errorReport:none /MD /O2 /Oy- /bigobj /utf-8 /permissive- /Zc:__cplusplus /Zc:sizedDealloc /volatile:iso /diagnostics:caret /std:c++17 /Gw /Gy /Zc:inline", "cxx" : "cl: Microsoft (R) C/C++ Optimizing Compiler Version 19.26.28806 for x64", "cxxflags" : "/TP", "linkflags" : "/nologo /DEBUG /INCREMENTAL:NO /LARGEADDRESSAWARE /OPT:REF", "target_arch" : "x86_64", "target_os" : "windows", "cppdefines" : "SAFEINT_USE_INTRINSICS 0 PCRE_STATIC NDEBUG BOOST_ALL_NO_LIB _UNICODE UNICODE _SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING _CONSOLE _CRT_SECURE_NO_WARNINGS _SCL_SECURE_NO_WARNINGS _WIN32_WINNT 0x0A00 BOOST_USE_WINAPI_VERSION 0x0A00 NTDDI_VERSION 0x0A000000 BOOST_THREAD_VERSION 5 BOOST_THREAD_USES_DATETIME BOOST_SYSTEM_NO_DEPRECATED BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS BOOST_ENABLE_ASSERT_DEBUG_HANDLER BOOST_LOG_NO_SHORTHAND_NAMES BOOST_LOG_USE_NATIVE_SYSLOG BOOST_LOG_WITHOUT_THREAD_ATTR ABSL_FORCE_ALIGNED_ACCESS" }, "bits" : 64, "debug" : false, "maxBsonObjectSize" : 16777216, "storageEngines" : [ "biggie", "devnull", "ephemeralForTest", "wiredTiger" ] } } >1 này không được áp dụng cho bạn. Ngay cả khi, các máy chủ MongoDB của bạn đang chạy dưới bộ bản sao, nó sẽ áp dụng cho bạn. Điều này được áp dụng cho chỉ chia sẻ môi trường. If you have a standalone MongoDB server then this > use local switched to db local > show collections startup_log > db.startup_log.find().pretty(); { "_id" : "DESKTOP-AJRAAJK-1607882562522", "hostname" : "DESKTOP-AJRAAJK", "startTime" : ISODate("2020-12-13T18:02:42Z"), "startTimeLocal" : "Sun Dec 13 23:32:42.522", "cmdLine" : { "config" : "C:\\Program Files\\MongoDB\\Server\\4.4\\bin\\mongod.cfg", "net" : { "bindIp" : "127.0.0.1", "port" : 27017 }, "service": true, "storage" : { "dbPath" : "C:\\Program Files\\MongoDB\\Server\\4.4\\data", "journal" : { "enabled" : true } }, "systemLog" : { "destination" : "file", "logAppend" : true, "path" : "C:\\Program Files\\MongoDB\\Server\\4.4\\log\\mongod.log" } }, "pid" : NumberLong(8700), "buildinfo" : { "version" : "4.4.2", "gitVersion" : "15e73dc5738d2278b688f8929aee605fe4279b0e", "targetMinOS" : "Windows 7/Windows Server 2008 R2", "modules" : [ ], "allocator" : "tcmalloc", "javascriptEngine" : "mozjs", "sysInfo" : "deprecated", "versionArray" : [ 4, 4, 2, 0 ], "openssl" : { "running" : "Windows SChannel" }, "buildEnvironment" : { "distmod" : "windows", "distarch" : "x86_64", "cc" : "cl: Microsoft (R) C/C++ Optimizing Compiler Version 19.26.28806 for x64", "ccflags" : "/nologo /EHsc /W3 /wd4068 /wd4244 /wd4267 /wd4290 /wd4351 /wd4355 /wd4373 /wd4800 /wd5041 /wd4291 /we4013 /we4099 /we4930 /WX /errorReport:none /MD /O2 /Oy- /bigobj /utf-8 /permissive- /Zc:__cplusplus /Zc:sizedDealloc /volatile:iso /diagnostics:caret /std:c++17 /Gw /Gy /Zc:inline", "cxx" : "cl: Microsoft (R) C/C++ Optimizing Compiler Version 19.26.28806 for x64", "cxxflags" : "/TP", "linkflags" : "/nologo /DEBUG /INCREMENTAL:NO /LARGEADDRESSAWARE /OPT:REF", "target_arch" : "x86_64", "target_os" : "windows", "cppdefines" : "SAFEINT_USE_INTRINSICS 0 PCRE_STATIC NDEBUG BOOST_ALL_NO_LIB _UNICODE UNICODE _SILENCE_CXX17_ALLOCATOR_VOID_DEPRECATION_WARNING _SILENCE_CXX17_OLD_ALLOCATOR_MEMBERS_DEPRECATION_WARNING _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING _CONSOLE _CRT_SECURE_NO_WARNINGS _SCL_SECURE_NO_WARNINGS _WIN32_WINNT 0x0A00 BOOST_USE_WINAPI_VERSION 0x0A00 NTDDI_VERSION 0x0A000000 BOOST_THREAD_VERSION 5 BOOST_THREAD_USES_DATETIME BOOST_SYSTEM_NO_DEPRECATED BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS BOOST_ENABLE_ASSERT_DEBUG_HANDLER BOOST_LOG_NO_SHORTHAND_NAMES BOOST_LOG_USE_NATIVE_SYSLOG BOOST_LOG_WITHOUT_THREAD_ATTR ABSL_FORCE_ALIGNED_ACCESS" }, "bits" : 64, "debug" : false, "maxBsonObjectSize" : 16777216, "storageEngines" : [ "biggie", "devnull", "ephemeralForTest", "wiredTiger" ] } } >1 database is not applicable for you. Even if, your MongoDB servers running under the Replica set, it will apply to you. This is applicable for only sharing environment. > use config switched to db config > show collections system.sessions > db.system.sessions.find().pretty(); { "_id" : { "id" : UUID("5d3d83a1-8c8a-4c1f-807f-f488ea93cf2b"), "uid" : BinData(0,"47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=") }, "lastUse" : ISODate("2020-12-13T18:42:42.883Z") } > 6. Đặt tên quy ước của cơ sở dữ liệu trong MongoDBSau đây là những điểm chính về quy ước đặt tên về cơ sở dữ liệu trong MongoDB.
> mongo show dbs; 7. Kết luậnTrong một vỏ đai, tất cả ba cơ sở dữ liệu mặc định:
Không gian tên: dbname.collectionName e2e.order Không gian tên: dbname.collectionName system.user 8. Người giới thiệuTrang web chính thức của MongoDB 9. Phiên bản video của bài đăng này: 13 lý do sử dụng MongoDB13 Lý do sử dụng MongoDB Phần 1 13 Lý do sử dụng MongoDB Phần 2 Nhận xét của bạn được hoan nghênh khuyến khích tôi thêm bài đăng và cải tiến quá. Vui lòng chia sẻ suy nghĩ của bạn, cách bạn tìm thấy cơ sở dữ liệu nội bộ này trong MongoDB, tức là cơ sở dữ liệu mặc định trong MongoDB. Học hỏi! Tên của cơ sở dữ liệu mặc định trong Atlas MongoDB là gì?Trong cơ sở dữ liệu mặc định MongoDB là thử nghiệm. Nếu bạn không tạo bất kỳ cơ sở dữ liệu nào, thì các bộ sưu tập sẽ được lưu trữ trong cơ sở dữ liệu thử nghiệm.test. If you didn't create any database, then collections will be stored in test database.
Loại cơ sở dữ liệu nào trong MongoDB?MongoDB là một chương trình quản lý cơ sở dữ liệu NoQuery nguồn mở.NoQuery được sử dụng thay thế cho cơ sở dữ liệu quan hệ truyền thống.Cơ sở dữ liệu NoQuery khá hữu ích cho việc làm việc với các bộ dữ liệu phân tán lớn.MongoDB là một công cụ có thể quản lý thông tin theo định hướng tài liệu, lưu trữ hoặc truy xuất thông tin.relational databases. NoSQL databases are quite useful for working with large sets of distributed data. MongoDB is a tool that can manage document-oriented information, store or retrieve information.
Tên bộ sưu tập trong MongoDB là gì?Một bộ sưu tập là một nhóm các tài liệu MongoDB.Tài liệu trong một bộ sưu tập có thể có các trường khác nhau.Một bộ sưu tập tương đương với một bảng trong một hệ thống cơ sở dữ liệu quan hệ.a grouping of MongoDB documents. Documents within a collection can have different fields. A collection is the equivalent of a table in a relational database system.
Cơ sở dữ liệu địa phương mongoDB là gì?Mỗi phiên bản Mongod đều có cơ sở dữ liệu cục bộ riêng, lưu trữ dữ liệu được sử dụng trong quy trình sao chép và dữ liệu cụ thể khác của phiên bản.Cơ sở dữ liệu cục bộ là vô hình để sao chép: các bộ sưu tập trong cơ sở dữ liệu cục bộ không được sao chép.stores data used in the replication process, and other instance-specific data. The local database is invisible to replication: collections in the local database are not replicated. |