Database Reference
In-Depth Information
5 points by kbanker 1 hour ago
Who was Alexander the Great's teacher?
2 points by asophist 1 hour ago
nitely Socrates.
10 points by daletheia 1 hour ago
Oh you sophist...It was actually Aristotle!
1 point by seuclid 2 hours ago
So who really discarded the parallel postulate?
Figure B.1
Threaded comments
in a forum
Let's see how these comments look as documents organized with a materialized path.
The first is a root-level comment, so the path is null :
{ _id: ObjectId("4d692b5d59e212384d95001"),
depth: 0,
path: null,
created: ISODate("2011-02-26T17:18:01.251Z"),
username: "plotinus",
body: "Who was Alexander the Great's teacher?",
thread_id: ObjectId("4d692b5d59e212384d95223a")
}
The other root-level question, the one by user seuclid , will have the same structure.
More illustrative are the follow-up comments to the question about Alexander the
Great's teacher. Examine the first of these, and note that path contains the _id of the
immediate parent:
{ _id: ObjectId("4d692b5d59e212384d951002"),
depth: 1,
path: "4d692b5d59e212384d95001",
created: ISODate("2011-02-26T17:21:01.251Z"),
username: "asophist",
body: "It was definitely Socrates.",
thread_id: ObjectId("4d692b5d59e212384d95223a")
}
The next deeper comment's path contains both the ID s of the original and immediate
parents, in that order and separated by a colon:
{ _id: ObjectId("4d692b5d59e212384d95003"),
depth: 2,
path: "4d692b5d59e212384d95001:4d692b5d59e212384d951002",
created: ISODate("2011-02-26T17:21:01.251Z"),
username: "daletheia",
body: "Oh you sophist...It was actually Aristotle!",
thread_id: ObjectId("4d692b5d59e212384d95223a")
}
Search WWH ::




Custom Search