what is the best way to set a property aof a javascript json object by its key

Here are my datas in a fokontanys.json file:

{
  "vzdveg643": {
    "lldistrict":"Ambilobe",
    "id_province": 7,
    "id": null
  },
  "vzvsdv5327": {
    "lldistrict":"Ambilobe",
    "id_province": 7,
    "id": null
  }
}

I need to replace the “null” value of “id” with the key of each object. I imported the json file

let fokontanys = require("./fokontanys.json");

And made a foreach inside of which i made my modifications:

Object.keys(fokontanys).forEach(function (fokontany) {    
  fokontanys[fokontany].ll_district=fokontanys[fokontany].lldistrict;
  fokontanys[fokontany].id="????????????????";
  delete fokontanys[fokontany].lldistrict;
  newFokontanys[fokontany] = fokontanys[fokontany];
});
console.log(newFokontanys);

Is there any way to get the Key of each object and put it in the id? I have spent a whole day to find how to do it without any success. Thank you for any help.

Answer

Based on your example you can just replace "????????????????" with fokontany which is already a key of each object.

const fokontanys = {
  "vzdveg643": {
    "lldistrict":"Ambilobe",
    "id_province": 7,
    "id": null
  },
  "vzvsdv5327": {
    "lldistrict":"Ambilobe",
    "id_province": 7,
    "id": null
  }
}

const newFokontanys = {}

Object.keys(fokontanys).forEach(function (fokontany) { 
  fokontanys[fokontany].ll_district=fokontanys[fokontany].lldistrict;
  fokontanys[fokontany].id=fokontany;
  delete fokontanys[fokontany].lldistrict;
  newFokontanys[fokontany] = fokontanys[fokontany];
});

console.log(newFokontanys);