Which is better in MongoDB to use when saving documents ?
Save
const data = { "name": "Jerry", "password": "#343@" };
const newUser = new User(data);
const result = await newUser.save()
Create
const result = await User.create({
"name": "Jerry", "password": "#343@"
})
Thank you, please follow me
Top comments (0)