How to replace doc data with another data in mongodb (using expressjs)

Viewed 13

i want to replace all doc data with another data

example:

let decks = await Deck.find({}); // Deck = Model.prototype
replaceAllDeck(decks); // Change everything in my mind

// example: replace all doc data (non method)
Deck.replaceAlldata(decks);

How can I perform functions such as Deck.replaceAllData()?

0 Answers
Related