私はジョブと呼ばれるMongoDBのコレクションを持っています
Job{
_id : ‘12344’,
cust_id: 'cust1',
title: 'Create Website',
description: 'We require it in 2 weeks only',
location: 'japan',
images:{
'image1',
'image2',
'image3'
},
video:{
'video1',
'video2'
},
budget:'15000',
duration:'2 weeks',
Proposals:[{
"sender_id" => "5",
"description" =>"I can do your task before 2 week",
"date" => "2013-08-05"
},
{
"sender_id" => "6",
"description" =>"I can do your task in 2 week, with best quality",
"date" => "2013-08-05"
}
]
}
以下のように、sender_id=5 のプロポーザル属性にメッセージを追加したい。
Job{
_id : ‘12344’,
cust_id: 'cust1',
title: 'Create Website',
description: 'We require it in 2 weeks only',
location: 'japan',
images:{
'image1',
'image2',
'image3'
},
video:{
'video1',
'video2'
},
budget:'15000',
duration:'2 weeks',
Proposals:[{
"sender_id" => "5",
"description" =>"I can do your task before 2 week",
"date" => "2013-08-05"
“messages”:[{
"message_sender" :"Can we meet",
"date" : "2013-08-06"
}
]
},
{
"sender_id" => "6",
"description" =>"I can do your task in 2 week, with best quality",
"date" => "2013-08-05"
}
]
}
私の文書は、
$document = array(
"message_sender" =>"Can we meet",
"date" => "2013-08-06"
);
私は本当にこのことをするのに苦労しています。これは、提案配列にメッセージを追加します。PHP コードに関するヘルプはありますか?