我正在使用 mongodb 和 php 构建一个项目,所以我的数据库包含以下记录。
{
"_id": {
"$id": "515bb7e2a00b2add0b000001"
},
"user_id": "user_8888",
"events": {
"common test I": {
"subject": "common test I",
"start_date": "04/14/2013",
"start_time": "8.00 AM",
"end_date": "04/14/2013",
"end_time": "10.30 AM",
"all_day_event": "false",
"discription": "no discription",
"location": "STC",
"private": "false",
"time_zone": "IST",
"alarm": "true",
"alarm_threshold": "5",
"status": "true"
}
}
}
所以只使用查询,我如何从记录中检索“common test I”事件。结果应该是:
{
"subject": "common test I",
"start_date": "04/14/2013",
"start_time": "8.00 AM",
"end_date": "04/14/2013",
"end_time": "10.30 AM",
"all_day_event": "false",
"discription": "no discription",
"location": "STC",
"private": "false",
"time_zone": "IST",
"alarm": "true",
"alarm_threshold": "5",
"status": "true"
}
是否可以?