-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.js
More file actions
44 lines (42 loc) · 743 Bytes
/
init.js
File metadata and controls
44 lines (42 loc) · 743 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
const PostModel = require('./models/post');
(async () => {
const a = new PostModel({
title: 'Post1',
text: 'Text',
authorName: 'Person1',
comments: [
{
id: 0,
authorName: 'Sparky',
text: 'Lol!',
},
{
id: 1,
authorName: 'Ken',
text: 'Lol!',
},
{
id: 2,
authorName: 'Sparky',
text: 'Lol!',
}]
});
await a.save();
const b = new PostModel({
title: 'Post2',
text: 'Text',
authorName: 'Person1',
comments: [
{
id: 0,
authorName: 'Ken',
text: 'Lol!',
},
{
id: 1,
authorName: 'Ken',
text: 'Lol!',
}]
});
await b.save();
})();