14 lines
326 B
JavaScript
14 lines
326 B
JavaScript
|
require('../src/db/mongoose')
|
||
|
const User = require('../src/models/user')
|
||
|
|
||
|
// 5e519e3404357c00d0777aee
|
||
|
|
||
|
User.findByIdAndUpdate('5e52f2612f736700e5a20797', { age: 1 }).then((user) => {
|
||
|
console.log(user)
|
||
|
return User.countDocuments({ age: 1 })
|
||
|
}).then((result) => {
|
||
|
console.log(result)
|
||
|
}).catch((e) => {
|
||
|
console.log(e)
|
||
|
})
|