Into the DataVerse - Ajarlin/MongoDB_notes GitHub Wiki
Run Mongodb
node test\connection.js
Example of a database/Collections
db1 | db2
Human Characters | Pokemon Moves
Pokemon Characters | stats
db1(Schema)
Human Characters
{
name: 'Ash'
weight: 115
}
{
name: 'Misty'
weight: 105
}
const schema = mongoose.schema;
//Create Schema and Model
const human_char_schema = new Schema({
name: String,
weight: Number
});
const humar_char = mongoose.model('human_char', human_char_schema);
//to export modules
module.exports = human_char;