0
collections:
posts: ->
# @getCollection('documents').findAllLive({relativeDirPath: 'posts'}, [date: -1])
@getCollection('documents').findAllLive({relativeDirPath: {'$in' : ['posts', /post\/[0-9]+/ ]}}, [date: -1])
在主要,{relativeDirPath: {'$in' : ['posts']}
是标准的事情。如何使用模式匹配获取路径中的集合?
但是,{relativeDirPath: {'$in' : ['posts', /post\/[0-9]+/ ]}
没有。
我试图让那些在下面的目录结构添加到收藏posts
文件:
/src/documents/posts/blah-blah.html
/src/documents/post/12345678/foo-bar-baz.html
/src/documents/post/62347878/woop-woop.html
...和使用模式在relativeDirPath
匹配似乎是要走的路。 但是,它不匹配任何这些文件。 我该如何做这项工作?