1const Person = mongoose.model('Person', Schema({
2 name: String,
3 rank: String
4}));
5
6const doc = new Person({
7 name: 'Will Riker',
8 rank: 'Commander'
9});
10// Inserts a new document with `name = 'Will Riker'` and
11// `rank = 'Commander'`
12await doc.save();
13
14const person = await Person.findOne();
15person.name; // 'Will Riker'