Collections
Expansive provides a Collections facility for managing lists of items that can be statically defined in expansive.json files or can be manipulated via scripting.
Static Collections
You can define collections in expansive.json via the control.collections property. For example:
{ control: { collections: { downloads: [ 'public/*.gz', ] } } }
This adds public/*.gz to the downloads collection.
Scripted Collections
You can use the APIs from embedded Javascript.
- addItems(collection, items)
- getItems(collection)
- removeItems(collection, items)
- resetItems(collection)
Queries
Expansive provides a powerful query API to manage files. The getFiles API can query the meta data of source files and return a list of matching files.
<@ var list = getFiles({ isPublic: true }) @>
This will return a list of filenames for documents that have meta data isPublic set to true.