關(guān)于自增主鍵:
const _ = db.command
db.collection('video').doc('video-id').update({
data: {
total_likes: _.inc(1)
}
})
//自增
const _ = db.command
db.collection('video').doc('video-id').update({
data: {
total_likes: _.inc(1)
}
})
//自增