# Create 1st Topic

Use the following http request to create a new topic with a title:

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

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

# Events collection

This results in a new record within events collection:

{
    "_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"
    }
}
1
2
3
4
5
6
7
8
9
10
11
12

# Topics collection

As well as a new record within topics collection:

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

# Threads collection

And in threads collection:

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

    ]
}
1
2
3
4
5
6
7
8
Last Updated: 11/27/2019, 3:58:28 PM