我有数据库的数据结构(model : Record):
{
"_id": {
"$oid": "5141ae831229bc11b0000001"
},
"attend_date": "2013-03-14",
"checkins": [
{
"_id": {
"$oid": "5141ae831229bc11b0000002"
},
"check_unit_id": {
"$oid": "5138ae3b1229bcc4d800000b"
},
"behave_id": {
"$oid": "5138ae3b1229bcc4d8000001"
}
},
{
"_id": {
"$oid": "5141ae831229bc11b0000003"
},
"check_unit_id": {
"$oid": "5138ae3b1229bcc4d800000c"
},
"behave_id": {
"$oid": "5138ae3b1229bcc4d8000001"
}
}
],
"created_at": {
"$date": "2013-03-14T11:03:31.819Z"
},
"record_person": "廖玥",
"record_zone": "4028809b3c6fbaa7013c6fbc39900382",
"staffid": "4028809b3c6fbaa7013c6fbc3da51b3d",
"state": "checking",
"updated_at": {
"$date": "2013-03-14T11:03:31.819Z"
}
}
我想通过类似查询语句: Record.where(state:"checking").where(checkins.behave_id: "...." ),形式 筛选出想要的 records, 我的这个查询语句该怎么写呢?求指教。