# How declare statement will work

**URL:** <https://forum.genieacs.com/t/how-declare-statement-will-work/5404>\
**Category:** Uncategorized\
**Created:** [May 8, 2024, 5:05am UTC](https://forum.genieacs.com/t/how-declare-statement-will-work/5404 "2024-05-08T05:05:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gokila](https://avatars.discourse-cdn.com/v4/letter/g/e9bcb4/32.png) [@Gokila](https://forum.genieacs.com/u/Gokila)\
**Post date:** [May 8, 2024, 5:05am UTC](https://forum.genieacs.com/t/how-declare-statement-will-work/5404/1 "2024-05-08T05:05:51Z")

</div>

HI,

In password update provision we are having below declare statement

declare(“Device.ManagementServer.Password”, {value: 1}, {value: password});

This will execute whenever 0 BOOTSTRAP received from device.

So i want to understand what this declare statement will do on both device and server side.

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [May 8, 2024, 9:31pm UTC](https://forum.genieacs.com/t/how-declare-statement-will-work/5404/2 "2024-05-08T21:31:16Z")

</div>

Sets the value of the given parameter on the CPE.

[https://docs.genieacs.com/en/latest/provisions.html](https://docs.genieacs.com/en/latest/provisions.html)

---

<div class="post-metadata">

**Author:** ![Gokila](https://avatars.discourse-cdn.com/v4/letter/g/e9bcb4/32.png) [@Gokila](https://forum.genieacs.com/u/Gokila)\
**Post date:** [May 9, 2024, 9:27am UTC](https://forum.genieacs.com/t/how-declare-statement-will-work/5404/3 "2024-05-09T09:27:29Z")

</div>

Thank you for your reply.

Yes we understood that it will send the parameter towards CPE to set that value . But we also need to know is whether this declare function will update anything on our DB

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [May 9, 2024, 8:34pm UTC](https://forum.genieacs.com/t/how-declare-statement-will-work/5404/4 "2024-05-09T20:34:27Z")

</div>

> [@Gokila](#):
>
> But we also need to know is whether this declare function will update anything on our DB

Yes. GenieACS caches the values in the Mongo DB.

---

<div class="post-metadata">

**Author:** ![Gokila](https://avatars.discourse-cdn.com/v4/letter/g/e9bcb4/32.png) [@Gokila](https://forum.genieacs.com/u/Gokila)\
**Post date:** [May 14, 2024, 2:34am UTC](https://forum.genieacs.com/t/how-declare-statement-will-work/5404/5 "2024-05-14T02:34:31Z")

</div>

when GenieACS will update the MongoDB, whether it will update after setparameter request sent to CPE or before setparameter request or after set parameter response received from CPE?

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [May 14, 2024, 4:38pm UTC](https://forum.genieacs.com/t/how-declare-statement-will-work/5404/6 "2024-05-14T16:38:08Z")

</div>

You would need to read the code to confirm, but I believe the values are committed to the db after the CPE acknowledges the SPV.

---

<div class="post-metadata">

**Author:** ![Gokila](https://avatars.discourse-cdn.com/v4/letter/g/e9bcb4/32.png) [@Gokila](https://forum.genieacs.com/u/Gokila)\
**Post date:** [May 15, 2024, 5:33am UTC](https://forum.genieacs.com/t/how-declare-statement-will-work/5404/7 "2024-05-15T05:33:31Z")

</div>

In the debug logs files,

event: incoming HTTP request

timestamp: 2024-05-09T04:15:22.402Z

connection: 2024-05-09T04:15:22.402Z

this above timestamp timestamp: 2024-05-09T04:15:22.402Z is setparameter response value received from device

but i have checked Database device table password updated time is 2024-05-09T04:15:22.102Z

debuglogs will have exact time of session connection or data wil write in DB after session completed.
