-
Notifications
You must be signed in to change notification settings - Fork 0
/
init-mongodb.js
64 lines (62 loc) · 1.37 KB
/
init-mongodb.js
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
db = db.getSiblingDB('social_service');
db.createCollection('posts');
db.createCollection('users');
db.posts.insertMany([
{
"author_user_id": 17,
"content": "Mi Primera Publicacion :D",
"likes_count" : 0,
"created_at": ISODate("2024-04-15T05:33:33.127Z"),
"updated_at": ISODate("2024-04-15T05:33:33.127Z"),
"comments": [
{
"id": "fdfe6218-64f7-4f89-af36-42b8b035f4c8",
"author": 11,
"content": "bien ahi!!",
"created_at": ISODate("2024-04-16T05:35:30.127Z")
}
],
"comments_count": 1,
"tags": [],
"photo_links": [],
},
{
"author_user_id": 17,
"content": "Ya soy influenceeeer",
"likes_count" : 0,
"created_at": ISODate("2024-04-19T02:15:30.217Z"),
"updated_at": ISODate("2024-04-19T02:15:30.217Z"),
"tags": ["influencers"],
"comments": [],
"comments_count": 0,
"photo_links": []
}
])
// https://github.com/Hanagotchi/users/blob/master/app/docker/tablas.sql
// create the users collection with the same structure as the users table!
db.users.insertMany([
{
"_id": 1,
"followers": [],
"following": [],
"tags": []
},
{
"_id": 2,
"followers": [],
"following": [],
"tags": []
},
{
"_id": 3,
"followers": [],
"following": [],
"tags": []
},
{
"_id": 4,
"followers": [],
"following": [],
"tags": []
}
])