我在我的数据库中有这个:
{
"id": "d40110a1-c0ca-47e0-95ca-086e905dd53c",
"somefiled": [
{
"city_name": "Aadorf",
"de": "Aadorf",
"en": "Aadorf",
"fr": "Aadorf",
"it": "Aadorf",
"kanton_de": "Thurgau",
"kanton_en": "Thurgovie",
"kanton_fr": "Thurgau",
"kanton_it": "Turgovia"
},
{
"city_name": "Aarau",
"de": "Aarau",
"en": "Aarau",
"fr": "Aarau",
"it": "Aarau",
"kanton_de": "Aargau",
"kanton_en": "Argovie",
"kanton_fr": "Aargau",
"kanton_it": "Argovia"
}//many more records here]
}
如何在somefiled
中提取kanton_en
的值为Argovie的所有数组元素?
这样的事情:
r.db("test").table("table").getField("somefiled").filter(function(row){
return row("kanton_en").eq("Argovie")
})
但那当然没有任何回报。
答案 0 :(得分:1)
解决:
array_chunk($files, 6)