So you've gotten a basic exposure to the workings of mongodb.
One big challenge is actually knowing what's being stored in your database (the organization and content). That's why typically we use an ORM (Object-relational mapping) to define our schema so we know what's actually in our database. Otherwise, sharing this amoung multiple developers it's hard to figure out what data actually exists (Especially when dealing with a schemaless database)
var kittySchema = mongoose.Schema({
name: String
});
This defines that in our Mongo Database, we're going to store an object that contains a name. We can use this information to find objects in our database as needed.
So you've gotten a basic exposure to the workings of mongodb.
One big challenge is actually knowing what's being stored in your database (the organization and content). That's why typically we use an
ORM
(Object-relational mapping) to define our schema so we know what's actually in our database. Otherwise, sharing this amoung multiple developers it's hard to figure out what data actually exists (Especially when dealing with a schemaless database)This defines that in our
Mongo
Database, we're going to store an object that contains a name. We can use this information to find objects in our database as needed.This is on our step to ultimately setting up an api, as Mongoose is the thing I pretty much use on every project.