Answer the question
In order to leave comments, you need to log in
What is the correct way to store a model in MongoDB?
The code:
import Game from '../models/game';
const game = new Game({
timeCreated: Date.now()
});
game.save((err, game) => {
if(err) {
console.log(err);
return callback(err, null);
}
return callback(null, game);
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question