# ormEvictCollection

This will remove all the entries with the specified relation/collection name in the specified component.




### Syntax

```
ormEvictCollection(entityName, collectionName [, primaryKey]) returns void
```






## Argument Reference

| Name | Type | Required | Default | Description | Values |
| --- | --- | --- | --- | --- | --- |
| entityName | string | Yes |  | Entity name of the persistent CFC |  |
| collectionName | string | Yes |  | Name of the collection in the component |  |
| primaryKey | string | No |  | Primary key of the collection or association data of the entity |  |





## CFML Engine Support

The ormEvictCollection function is supported on the following CFML engines:

| Engine | Minimum Version | Notes |
| --- | --- | --- |
| ColdFusion | 9 |  |
| Lucee |  |  |
| BoxLang | 1.0.0 |  |




## Examples


### Tag Example

To evict all the association or collection data of collection `arts` belonging to the component `CArtists`

```
<cfset ormEvictCollection("CArtists", "arts")>
```






## Related Tags and Functions

[ormEvictEntity](https://cfdocs.org/ormEvictEntity.md)
[ormEvictQueries](https://cfdocs.org/ormEvictQueries.md)




The human version of this document can be found here: [https://cfdocs.org/ormevictcollection](https://cfdocs.org/ormevictcollection) which is part of the cfdocs.org repository. Project created by [Pete Freitag](https://www.petefreitag.com) and sponsored by [Foundeo Inc.](https://foundeo.com/)
