I am saving a value to my Dexie (IndexedDB) database, using put(), and I immediately need to know what the key of that new entry is. How do I go about doing that?
The below is my code. I wasn't able to find a solution searching with Google. Thanks!
let newDog = {
armbandNumber: this.armbandMax,
dogCallName: this.callName,
dogRegName: this.regName,
dogOwnerKey: this.dogOwner.value,
dogOwner: this.dogOwner.label,
dogCoOwner: this.dogCoOwner,
dogHandler: this.dogHandler.value,
dogBday: this.dogBday,
dogBreed: this.dogBreed,
dogHeight: this.dogHeight,
dogVariety: this.dogVariety,
dogSire: this.dogSire,
dogDam: this.dogDam,
dogBreeder: this.dogBreeder,
akcNum: this.akcNum,
bhaNum: this.bhaNum,
dogGender: this.dogGenderModel,
dateDogAdded: Date.now(),
barnHuntLevel: this.bhLevelModel,
barnHuntClassAB: this.bhLevelModelAB,
dogHeightDivision: this.heightDivision,
scentWorkLevel: this.swLevelModel,
scentWorkClassAB: this.swLevelModelAB,
}
pawTapDB.dogTable.put(newDog)