# Create 2nd Topic

Creating another Topic with another request

POST /api/createTopic HTTP/1.1
Content-Type: application/json

{
  "title": "This is a 2nd Topic"
}
1
2
3
4
5
6

# Events collection

Adds another Topic.created event:













 
 
 
 
 
 
 
 
 
 
 
 

{
    "_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"
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

# Topics collection

Adds a new topic record:






 
 
 
 
 

{
    "_id" : ObjectId("5dde6aab5aad123cee5da6c7"),
    "title" : "This is a 1st Topic",
    "countComments" : NumberInt(0)
}
{
    "_id" : ObjectId("5dde75915aad123cee5da6c9"),
    "title" : "This is a 2nd Topic",
    "countComments" : NumberInt(0)
}
1
2
3
4
5
6
7
8
9
10

# Threads collection

And adds a new thread record:









 
 
 
 
 
 
 
 

{
    "_id" : ObjectId("5dde6aab5aad123cee5da6c7"),
    "title" : "This is a 1st Topic",
    "countComments" : NumberInt(0),
    "children" : [

    ]
}
{
    "_id" : ObjectId("5dde75915aad123cee5da6c9"),
    "title" : "This is a 2nd Topic",
    "countComments" : NumberInt(0),
    "children" : [

    ]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Last Updated: 11/27/2019, 3:58:28 PM