How to remove something from quick.db array Discord.js

I am trying to remove something from quick.db array, via args[0]. But I have no idea how to do it, I read the documentation, but did not understand.

1 Like

Here is an example:

await db.delete('colors.red')
// My array has 3 colors: red, blue, and green

now to delete using args use this:

let args = ...

await db.delete('colors.args")

Let me know if something doesn’t work

What if I have such an array?

await db.get(`abig_${message.guild.id}`)

yeah then do

let args = ...

await db.delete(`abig_${message.guild.id.args`)

Doesn’t work, I get args[0] -

await db.delete(`abig_${message.guild.id.args[0]}`)
                                                ^
TypeError: Cannot read properties of undefined (reading '0')

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.