MongoDB is written in C++ language and is an open source database system based on distributed file storage. "Black Horse Cloud Classroom MongoDB Practical Video Tutorial" ensures the completeness of knowledge points to a large extent. The starting point of the video is carefully designed and recorded for students who have certain database knowledge. Ensure that students can accept and understand the details of knowledge to a greater extent.
Video playback address: http://www.php.cn/course/519.html
The teacher’s teaching style:
is vivid, witty, witty, and touching. A vivid metaphor is like the finishing touch, opening the door to wisdom for students; a well-placed humor brings a knowing smile to students, like drinking a glass of mellow wine, giving people aftertaste and nostalgia; a philosopher's aphorisms, cultural references Proverbs are interspersed from time to time in the narration, giving people thinking and alertness.
The more difficult point in this video is to manage the mongodb account permissions:
MongoDB does not have permission verification by default. But in a production environment, it is very unsafe without permission control.
Without going into too many concepts in detail, let’s create two typical accounts directly:
Super administrator, similar to the sa account of sql server or the root account of mysql
Read and write permission account for a single database
Create super administrator
When the permission verification mechanism is not turned on, we use mongo to open the MongoDB shell in the "Command Indicator" window.
Use the "use" command to switch to the admin database. MongoDB uses the system.users collection of admin to save user information.
> use admin switched to db admin >
Use the db.createUser method to create a user. For specific instructions, please refer to the official website document
> db.createUser(... {... user: "sa",... pwd: "123",... roles: [ { role: "__system", db: "admin" } ]... }... ) Successfully added user: { "user" : "sa", "roles" : [ { "role" : "__system", "db" : "admin" } ] } >
In this way we create an account :sa, password: 123, has the permissions of the "__system" role. For specific instructions on the "__system" role, please refer to the official website document
Warning: Do not assign accounts with the "__system" role to system programs.
Here we also recommend downloading source code resources: http://www.php.cn /xiazai/learn/2073
The resources share video courseware and ppt with you:
corresponding notes+PPT+template+source code download address
黑马云Classroommongodbpractical source code courseware
The above is the detailed content of Recommended source code courseware for Black Horse Cloud Classroom mongodb practical video. For more information, please follow other related articles on the PHP Chinese website!