# Iterator v/s cdb\_get() in process\_update() of subscription handler

**URL:** <https://dmap-community.ductus.global/t/iterator-v-s-cdb-get-in-process-update-of-subscription-handler/4695>\
**Category:** General\
**Created:** [May 20, 2024, 9:10am UTC](https://dmap-community.ductus.global/t/iterator-v-s-cdb-get-in-process-update-of-subscription-handler/4695 "2024-05-20T09:10:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![evnavya](https://avatars.discourse-cdn.com/v4/letter/e/b4bc9f/32.png) [@evnavya](https://dmap-community.ductus.global/u/evnavya)\
**Post date:** [May 20, 2024, 9:10am UTC](https://dmap-community.ductus.global/t/iterator-v-s-cdb-get-in-process-update-of-subscription-handler/4695/1 "2024-05-20T09:10:56Z")

</div>

When writing a subscription handler, in process\_update() is it mandatory to use iterator when the subscribed path is only to a single leaf with a default value?

Is it a good practise to directly read the value of the leaf using cdb\_get() in process\_update() instead of writing an iterator with MOP\_DELETE/MOP\_CREATED/MOP\_SET cases and read accordingly?

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [May 24, 2024, 10:03am UTC](https://dmap-community.ductus.global/t/iterator-v-s-cdb-get-in-process-update-of-subscription-handler/4695/2 "2024-05-24T10:03:23Z")

</div>

> [@evnavya](#):
>
> When writing a subscription handler, in process\_update() is it mandatory to use iterator when the subscribed path is only to a single leaf with a default value?

If the subscribed path is a single leaf, just read the single leaf. There is no need for an iterator or other variants, such as get\_modifications(), as you know what changed.
