From the course: MongoDB Cloud Essential Training
Unlock the full course today
Join today to access over 23,400 courses taught by industry experts.
Implementing data schemas - MongoDB Tutorial
From the course: MongoDB Cloud Essential Training
Implementing data schemas
- One feature we haven't used yet is the MongoDB Schema. We've talked about it briefly, but we've not implemented it in reality. Let's go ahead and change this. So we're just going to do a very simple schema here, and just going to see how schemas work. And one thing with schemas is you can actually generate a schema. You can click 'Generate Schema'. And what would happen is MongoDB will go into your collection and, generate a schema based on the documents it finds. So we can sample 500 documents or something like this, and you can just click 'Generate Schema. Then you can see that MongoDB has gone in there, and it's found a bunch of properties, ID, comment, co-mentor and site ID. And you going to see that these are properties that we created. Now on the school ID is reserved, so we didn't really create that 'cause MongoDB does that automatically. So let's go ahead and change something quickly. Let's try to put a…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.