File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ structure like the following:
95
95
_id: ObjectId(...),
96
96
discussion_id: ObjectId(...),
97
97
parent_id: ObjectId(...),
98
- slug: '34db/8bda'
98
+ slug: '34db/8bda',
99
99
full_slug: '2012.02.08.12.21.08:34db/2012.02.09.22.19.16:8bda',
100
100
posted: ISODateTime(...),
101
101
author: {
@@ -254,7 +254,8 @@ comments, you can select by the ``slug`` field:
254
254
255
255
comment = db.comments.find_one({
256
256
'discussion_id': discussion_id,
257
- 'slug': comment_slug})
257
+ 'slug': comment_slug
258
+ })
258
259
259
260
You can retrieve a "sub-discussion," or a comment and all of its
260
261
descendants recursively, by performing a regular expression prefix
@@ -266,7 +267,8 @@ query on the ``full_slug`` field:
266
267
267
268
subdiscussion = db.comments.find_one({
268
269
'discussion_id': discussion_id,
269
- 'full_slug': re.compile('^' + re.escape(parent_slug)) })
270
+ 'full_slug': re.compile('^' + re.escape(parent_slug))
271
+ })
270
272
subdiscussion = subdiscussion.sort('full_slug')
271
273
272
274
Indexing
You can’t perform that action at this time.
0 commit comments