Skip to content

Latest commit

 

History

History
25 lines (15 loc) · 1.4 KB

how-to-customize-collection-assignment-for-entities.js.markdown

File metadata and controls

25 lines (15 loc) · 1.4 KB

Session: How to Customize Collection Assignment for Entities

Entities are grouped into collections on the server side. In order to determine the collection name that an entity belongs to there is special convention which return the collection name based on the type of an entity: findCollectionName.

Example

By default a collection name is pluralized form of a name of an entity type. For example objects of type Category will belong to Categories collection. However if your intention is to classify them as ProductGroups you can use the following code:

{CODE:nodejs custom_collection_name@client-api\session\configuration\customizeCollectionAssignmentForEntities.js /}

This can become very useful when there is a need to deal with polymorphic data.

Related articles

Configuration

FAQ