📌  相关文章
📜  mongodb 从数组中删除第一个元素 - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:14.010000             🧑  作者: Mango

代码示例1
// Exampmle of document
{ _id: 1, scores: [ 8, 9, 10 ] }

// The following example removes the first element (8) in the scores array:
db.students.update( { _id: 1 }, { $pop: { scores: -1 } } )