K
K
Killsayden2020-11-06 10:16:24
MongoDB
Killsayden, 2020-11-06 10:16:24

How to overwrite MongoDB discord.js collection?

Info.create({ 
                        rIMG: "ПЕРЕМЕННАЯ С КАРТИНКОЙ",
                        rTITLE: 'ПЕРЕМЕННАЯ С НАЗВАНИЕМ',
                        uID: message.author.id
                    })

How can you overwrite a variable with a name?
It is desirable that it overwrites the entire collection and without filtering

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita Kudrin, 2020-11-06
@Killsayden

What is not clear here?

let info = await Info.findOne({ uID: message.author.id }); // Получаем это из коллекции MongoDB
info.rIMG = "ссылка на картинку"; // Меняем.
info.save(); // Сохраняем

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question