Reputation: 117
This is my code:
function remove(guild, u) {
return db.updateOne({ guild }, {
$pull: { "feeds": { "user": { "screen_name": u } } }
})
}
When I run remove("718471604291764295", "twitter")
it doesn't remove. My schema is:
{
guild: String,
feeds: [{
channel: String,
webhook: {
id: String,
token: String,
},
user: {
id: String,
screen_name: String,
}
}]
}
What's wrong with this?
Upvotes: 1
Views: 44
Reputation: 36114
user.screen_name: u
async function remove(guild, u) {
return await db.updateOne(
{ guild: },
{
$pull: {
feeds: {
"user.screen_name": u
}
}
}
)
}
Upvotes: 1