As discussed earlier, comments can be used by users to ask more questions or clarify something to other users. Since chronology is important, we will create a chain for the comments. The assumption here is that for a new question or clarification, a new comment chain will be started with the first comment in the chain being in response to the review being commented on.
Before we add comments, we should set up a constraint on comments to ensure that we don't create comments with the same ID, as shown in the following query:
neo4j-sh (?)$ CREATE CONSTRAINT ON (comment:Comment) ASSERT comment._id IS UNIQUE;
The output of the preceding query is as follows:
+-------------------+ | No data returned. | +-------------------+ Constraints ...
No credit card required