How to delete the embedded document in mongodb
{"_id" : ObjectId("5b83e0491ca61552dca474cd"),"title" : "9","updated" : [ ],"date" : ISODate("2018-08-27T20:28:09.566+09:00"),"count" : 4,"comments" : [{"name" : "글쓴이","memo" : "1","_id" : ObjectId("5b9b2ae6f195ca40bcc43802"),"date" : ISODate("2018-09-14T12:28:38.985+09:00")}],"contents" : "9","__v" : 2} findOneAndDelete 함수를 아래처럼 쓰면 embedded document만 삭제되는 게 아니라 글이 통째로 삭제된다. db.collection.findOn..
MongoDB findOneAndUpdate
1234567891011121314151617181920212223{ "_id" : ObjectId("5b77cf25cdc3bb21d0354be2"), "title" : "newnew", "updated" : [ ], "date" : ISODate("2018-08-18T16:47:49.841+09:00"), "count" : 389, "contents" : "new", "__v" : 18, "writer" : null, "comments" : [ { "name" : "글쓴이", "memo" : "!!!", "_id" : ObjectId("5b7be66d9ff77a3834943b8b"), "date" : ISODate("2018-08-21T19:16:13.788+09:00") } ],}Colored by ..