A CDR (Collection Definition Record) defines a specific collection in the Dgraph.
A collection is represented in the Dgraph by a Collection Definition Record (CDR). A CDR is created when the putCollection and the putCollections operations are successful. Although CDRs are not user-visible, the listCollections operation in effect returns a representation of the CDR via the collectionRecord element.
<collectionRecord collectionKey="Products" displayName="Product data" uniquePropertyKey="ProductID">
<description>product records for the region</description>
<property key="Region">New England</property>
<collectionAttributes/>
</collectionRecord>
Note that the collectionAttributes field is empty, which means that no records are associated with this collection at this time.
<collectionRecord collectionKey="Products" displayName="Product data" uniquePropertyKey="ProductID">
<description>product records for the region</description>
<property key="Region">New England</property>
<collectionAttributes>
<collectionAttribute propertyKey="Class"/>
<collectionAttribute propertyKey="Color"/>
<collectionAttribute propertyKey="DaysToManufacture"/>
<collectionAttribute propertyKey="DealerPrice"/>
<collectionAttribute propertyKey="FinishedGoodsFlag"/>
<collectionAttribute propertyKey="ListPrice"/>
<collectionAttribute propertyKey="ModelName"/>
<collectionAttribute propertyKey="ProductID"/>
<collectionAttribute propertyKey="ProductLine"/>
<collectionAttribute propertyKey="ProductSubcategoryKey"/>
<collectionAttribute propertyKey="ReorderPoint"/>
<collectionAttribute propertyKey="SafetyStockLevel"/>
<collectionAttribute propertyKey="Size"/>
<collectionAttribute propertyKey="SizeRange"/>
<collectionAttribute propertyKey="SizeUnitMeasureCode"/>
<collectionAttribute propertyKey="StandardCost"/>
<collectionAttribute propertyKey="Status"/>
<collectionAttribute propertyKey="Style"/>
<collectionAttribute propertyKey="Weight"/>
</collectionAttributes>
</collectionRecord>
Now the collectionAttributes field has been populated with the record attributes that comprise this collection.
| collectionRecord Property | Description |
|---|---|
| collectionKey | The name of the collection, used to specify this collection in all Endeca Server APIs (including queries). Set via the collection::collectionKey attribute. |
| displayName | An arbitrary string value that can be used by applications, intended for use as a user-friendly display name of the collection. Set via the collection::displayName attribute. |
| uniquePropertyKey | The standard attribute that determines which records will be part of this collection. Set via the collection::uniquePropertyKey attribute. |
| description | An arbitrary string value that can be used by applications, intended for use as a description of the collection. Set via the collection::description attribute. |
| property key | String metadata that is associated with the collection. Set via the collection::property key attribute. |
| collectionAttribute propertyKey | A standard attribute that belongs to the collection. These properties are added by the Dgraph during a record ingest operation and cannot be modified by the user. |