# How to remove entities from CustomDataSource

**URL:** <https://community.cesium.com/t/how-to-remove-entities-from-customdatasource/2862>\
**Category:** CesiumJS\
**Created:** [July 29, 2015, 6:21pm UTC](https://community.cesium.com/t/how-to-remove-entities-from-customdatasource/2862 "2015-07-29T18:21:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ebertr80](https://avatars.discourse-cdn.com/v4/letter/e/bb73d2/32.png) [@ebertr80](https://community.cesium.com/u/ebertr80)\
**Post date:** [July 29, 2015, 6:21pm UTC](https://community.cesium.com/t/how-to-remove-entities-from-customdatasource/2862/1 "2015-07-29T18:21:23Z")

</div>

I'm using several CustomDataSources in my project. Each of them has several hunderts of assigned entities. Once in a while (3-5minutes) I have to updates the entities, some will have to be deleted, some are new and some are the same as before. To make it easy I would like to delete all entities of a CustomDataSource and add an updated set of entities afterwards. Whatever I try it seems to remove the complete CustumDataSource, not only the entities. I tried e.g. :

Aircraft\_collection\_dataSource.entities.removeAll

Thanks for your help.

Ruediger

---

<div class="post-metadata">

**Author:** ![Matt\_Amato](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/matt_amato/32/1993_2.png) [@Matt\_Amato](https://community.cesium.com/u/Matt_Amato)\
**Post date:** [August 17, 2015, 8:51pm UTC](https://community.cesium.com/t/how-to-remove-entities-from-customdatasource/2862/2 "2015-08-17T20:51:31Z")

</div>

Did you ever figure out your problem? If not, try calling entities.suspendEvents(); at the beginning of your update code just before the removeAll and then entities.removeEvents(); at the end. Ideally, you would not update your data by removing everything first because it causes a lot of extra work to be done, but the suspend/resume calls should at least cut down a lot of it.
