Delete particular record

Hey, I tried to delete an object using this way
let removeData;>{
removeData = async() => {
const query = new Moralis.Query(‘ContactDetail’)
const object = await query.first(({useMasterKey: true}))
if(object) {
object.destroy().then(() => {
alert(“Deleted data!”);
}, (error) => {
I have 3 records in my table, when I tried to delete any one record then last record gets deleted so how I can delete a particular object onClick of the delete button?

try to add logging here, to see what object it returned

you can add logging after every line, to see if the data is what you expect

for example using console.log(JSON.stringify(object)) or depending on where that code runs

Okay, I will try but not delete particular record