collections:
posts: ->
# @getCollection('documents').findAllLive({relativeDirPath: 'posts'}, [date: -1])
@getCollection('documents').findAllLive({relativeDirPath: {'$in' : ['posts', /post\/[0-9]+/ ]}}, [date: -1])
主要docpad.coffee
是{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
似乎是要走的路。但是,它与这些文件中的任何一个都不匹配。我怎样才能使这项工作?