# Listing Collections

After sending some commands as HTTP-Request and recording all data changes as events, the events collection will grow and keep all changes. Meanwhile all projected views provide just the current state for reading.

# Events collection

Full listing of all events that ever happend in order:

{
    "_id" : ObjectId("5dde6aab5aad123cee5da6c8"),
    "aggregateId" : ObjectId("5dde6aab5aad123cee5da6c7"),
    "aggregateVersion" : NumberInt(0),
    "type" : "Topic.created",
    "payload" : {
        "title" : "This is a 1st Topic"
    },
    "context" : {
        "reqId" : "1b742a5c-4de5-4279-a1c7-2dd1918c9a90"
    }
}
{
    "_id" : ObjectId("5dde75915aad123cee5da6ca"),
    "aggregateId" : ObjectId("5dde75915aad123cee5da6c9"),
    "aggregateVersion" : NumberInt(0),
    "type" : "Topic.created",
    "payload" : {
        "title" : "This is a 2nd Topic"
    },
    "context" : {
        "reqId" : "7d76d01f-7489-463e-877f-802b3a914984"
    }
}
{
    "_id" : ObjectId("5dde77775aad123cee5da6cc"),
    "aggregateId" : ObjectId("5dde77775aad123cee5da6cb"),
    "aggregateVersion" : NumberInt(0),
    "type" : "Comment.created",
    "payload" : {
        "body" : "A 1st Comment on Topic #1",
        "topicId" : "5dde6aab5aad123cee5da6c7",
        "parentId" : "5dde6aab5aad123cee5da6c7",
        "countReplies" : NumberInt(0)
    },
    "context" : {
        "reqId" : "424f2987-2281-4779-9a18-7b8bd5eaf9d4"
    }
}
{
    "_id" : ObjectId("5dde84d05aad123cee5da6cd"),
    "aggregateId" : ObjectId("5dde75915aad123cee5da6c9"),
    "aggregateVersion" : NumberInt(1),
    "type" : "Topic.removed",
    "payload" : null,
    "context" : {
        "reqId" : "97440294-1c8d-4dae-8c4a-9189793d9460"
    }
}
{
    "_id" : ObjectId("5dde8b9f5aad123cee5da6cf"),
    "aggregateId" : ObjectId("5dde8b9f5aad123cee5da6ce"),
    "aggregateVersion" : NumberInt(0),
    "type" : "Comment.created",
    "payload" : {
        "body" : "And another Comment",
        "topicId" : "5dde6aab5aad123cee5da6c7",
        "parentId" : "5dde6aab5aad123cee5da6c7",
        "countReplies" : NumberInt(0)
    },
    "context" : {
        "reqId" : "c59d66c0-6e1e-45d2-b905-07625f7a4e74"
    }
}
{
    "_id" : ObjectId("5dde8bbc5aad123cee5da6d1"),
    "aggregateId" : ObjectId("5dde8bbc5aad123cee5da6d0"),
    "aggregateVersion" : NumberInt(0),
    "type" : "Comment.created",
    "payload" : {
        "body" : "For heavens sake... we add another silly comment",
        "topicId" : "5dde6aab5aad123cee5da6c7",
        "parentId" : "5dde6aab5aad123cee5da6c7",
        "countReplies" : NumberInt(0)
    },
    "context" : {
        "reqId" : "ea6cf49d-2d65-4d81-9030-a6a053d97281"
    }
}
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79

# Topics collection

The current state of topics - practically a list with just one entry:




 


{
    "_id" : ObjectId("5dde6aab5aad123cee5da6c7"),
    "title" : "This is a 1st Topic",
    "countComments" : NumberInt(3)
}
1
2
3
4
5

# Threads collection

The current state of threads - one thread with three comments on it:




 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


{
    "_id" : ObjectId("5dde6aab5aad123cee5da6c7"),
    "title" : "This is a 1st Topic",
    "countComments" : NumberInt(3),
    "children" : [
        {
            "_id" : ObjectId("5dde77775aad123cee5da6cb"),
            "body" : "A 1st Comment on Topic #1",
            "countReplies" : NumberInt(0)
        },
        {
            "_id" : ObjectId("5dde8b9f5aad123cee5da6ce"),
            "body" : "And another Comment",
            "countReplies" : NumberInt(0)
        },
        {
            "_id" : ObjectId("5dde8bbc5aad123cee5da6d0"),
            "body" : "For heavens sake... we add another silly comment",
            "countReplies" : NumberInt(0)
        }
    ]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

# Comments collection

And finally a list of all comments - in numbers: Three!








 
 
 
 
 
 
 
 
 
 
 
 
 
 

{
    "_id" : ObjectId("5dde77775aad123cee5da6cb"),
    "body" : "A 1st Comment on Topic #1",
    "topicId" : "5dde6aab5aad123cee5da6c7",
    "parentId" : "5dde6aab5aad123cee5da6c7",
    "countReplies" : NumberInt(0)
}
{
    "_id" : ObjectId("5dde8b9f5aad123cee5da6ce"),
    "body" : "And another Comment",
    "topicId" : "5dde6aab5aad123cee5da6c7",
    "parentId" : "5dde6aab5aad123cee5da6c7",
    "countReplies" : NumberInt(0)
}
{
    "_id" : ObjectId("5dde8bbc5aad123cee5da6d0"),
    "body" : "For heavens sake... we add another silly comment",
    "topicId" : "5dde6aab5aad123cee5da6c7",
    "parentId" : "5dde6aab5aad123cee5da6c7",
    "countReplies" : NumberInt(0)
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Last Updated: 11/27/2019, 3:58:28 PM