The compendium metadata which defines the compendium content and location
A subsidiary collection which contains the more minimal index of the pack
A reference to the Application class which provides an interface to interact with this compendium content.
An Array of application references which will be automatically updated when the collection content changes
Record the set of document ids where the Document was not initialized because of invalid source data
Private
#foldersThe set of Compendium Folders
Private
#indexedTrack which document fields have been indexed for this compendium pack
Static
CACHE_The amount of time that Document instances within this CompendiumCollection are held in memory. Accessing the contents of the Compendium pack extends the duration of this lifetime.
Static
CONFIG_The named game setting which contains Compendium configurations.
Static
documentThe base Document type which is contained within this DocumentCollection
The canonical Compendium name - comprised of the originating package and the pack name
The banner image for this Compendium pack, or the default image for the pack type if no image is set.
Get the sort order for this Compendium
Access the compendium configuration data for this pack
Track whether the Compendium Collection is locked for editing
The visibility configuration of this compendium pack.
Is this Compendium pack visible to the current game User?
A convenience reference to the label which should be used as the title for the Compendium pack.
The index fields which should be loaded for this compendium pack
Has this compendium pack been fully indexed?
The Collection class name
Assign this CompendiumCollection to be organized within a specific Folder.
The desired Folder within the World or null to clear the folder
A promise which resolves once the transaction is complete
Load the Compendium index and cache it as the keys and values of the Collection.
Optional
options: { Options which customize how the index is created
An array of fields to return as part of the index
Load multiple documents from the Compendium pack using a provided query object.
A database query used to retrieve documents from the underlying database
The retrieved Document instances
await pack.getDocuments({ type: "weapon" });
await pack.getDocuments({ _id__in: arrayOfIds });
await pack.getDocuments({ type__in: ["weapon", "armor"] });
Test whether a certain User has a requested permission level (or greater) over the Compendium pack
The User being tested
The permission level from DOCUMENT_OWNERSHIP_LEVELS to test
Additional options involved in the permission test
Require the exact permission level requested?
Does the user have this permission level over the Compendium pack?
Import a Document into this Compendium Collection.
The existing Document you wish to import
Optional
options: object = {}Additional options which modify how the data is imported. See ClientDocumentMixin#toCompendium
The imported Document instance
Import a Folder into this Compendium Collection.
The existing Folder you wish to import
Optional
options: { Additional options which modify how the data is imported.
Import any parent folders which are not already present in the Compendium
Import an array of Folders into this Compendium Collection.
The existing Folders you wish to import
Optional
options: { Additional options which modify how the data is imported.
Import any parent folders which are not already present in the Compendium
Fully import the contents of a Compendium pack into a World folder.
Optional
options: { Options which modify the import operation. Additional options are forwarded to WorldCollection#fromCompendium and Document.createDocuments
An existing Folder _id to use.
A new Folder name to create.
The imported Documents, now existing within the World
Provide a dialog form that prompts the user to import the full contents of a Compendium pack into the World.
Optional
options: object = {}Additional options passed to the Dialog.confirm method
A promise which resolves in the following ways: an array of imported Documents if the "yes" button was pressed, false if the "no" button was pressed, or null if the dialog was closed without making a choice.
Delete an existing world-level Compendium Collection. This action may only be performed for world-level packs by a Gamemaster User.
Duplicate a compendium pack to the current World.
A new Compendium label
Migrate a compendium pack. This operation re-saves all documents within the compendium pack to disk, applying the current data model. If the document type has system data, the latest system data template will also be applied to all documents.
Update all objects in this DocumentCollection with a provided transformation. Conditionally filter to only apply to Entities which match a certain condition.
An object of data or function to apply to all matched objects
A function which tests whether to target each object
Additional options passed to Document.updateDocuments
An array of updated data once the operation is complete
Internal
Follow-up actions to take when a database operation modifies Documents in this DocumentCollection.
The database action performed
The array of modified Documents
The result of the database operation
Database operation details
The User who performed the operation
Obtain a temporary Document instance for a document id which currently has invalid source data.
A document ID with invalid source data.
Optional
options: { Additional options to configure retrieval.
Throw an Error if the requested ID is not in the set of invalid IDs for this collection.
An in-memory instance for the invalid Document
If strict is true and the requested ID is not in the set of invalid IDs for this collection.
Find all Documents which match a given search term using a full-text search against their indexed HTML fields and their name. If filters are provided, results are filtered to only those that match the provided values.
An object configuring the search
A case-insensitive search string
An array of filters to apply
An array of document IDs to exclude from search results
Private
#assertStatic
_sortStatic
_activateStatic
createCreate a new Compendium Collection using provided metadata.
The compendium metadata used to create the new pack
Additional options which modify the Compendium creation request
Static
getGet the searchable fields for a given document or index, based on its data model
The document type name
Optional
documentSubtype: string = ""The document subtype name
Optional
isEmbedded: boolean = falseWhether the document is an embedded object
The dot-delimited property paths of searchable fields
Static
Private
#handleHandle a response from the server where a compendium was created.
The server response.
Static
Private
#handleHandle a response from the server where a compendium was deleted.
The server response.
A collection of Document objects contained within a specific compendium pack. Each Compendium pack has its own associated instance of the CompendiumCollection class which contains its contents.
Abstract
See
Param: metadata
The compendium metadata, an object provided by game.data