これは、1 つの mongodb レコードの json 表現です。
{
_id : ObjectId("4e77bb3b8a3e000000004f7a"),
when : Date("2011-09-19T02:10:11.3Z",
author : "alex",
title : "No Free Lunch",
text : "This is the text of the post. It could be very long.",
tags : [ "business", "ramblings" ],
votes : 5,
voters : [ "jane", "joe", "spencer", "phyllis", "li" ],
comments : [
{ who : "jane", when : Date("2011-09-19T04:00:10.112Z"),
comment : "I agree." },
{ who : "meghan", when : Date("2011-09-20T14:36:06.958Z"),
comment : "You must be joking. etc etc ..." }
]
}
comments
今、配列からコメントを削除したい場合、どうすればそれを行うことができるという問題がありますか?
コメント テキストに依存したくありません。
ドキュメント内のすべてのオブジェクトに ID を付与する機能はありますか。