[
{
"user_id" : 12453,
"profile_type" : "demo_type_1",
"records" : [
{
"type" : "typ_11",
"value" : {
"high" : 115,
"low" : 78
},
"_meta" : {
"data_type" : "text"
}
},
{
"type" : "type_1",
"files" : [
{
"title" : "path_prescription_1",
"url" : "/file_name.extension"
},
{
"title" : "path_prescription_2",
"url" : "/file_name__1.extension"
}
],
"_meta" : {
"data_type" : "file"
}
}
]
},
{
"user_id" : 12455,
"profile_type" : "demo_type_1",
"records" : [
{
"type" : "typ_11",
"value" : {
"high" : 115,
"low" : 78
},
"_meta" : {
"data_type" : "text"
}
},
{
"type" : "type_1",
"files" : [
{
"title" : "path_prescription_1",
"url" : "/file_name.extension"
},
{
"title" : "path_prescription_2",
"url" : "/file_name__1.extension"
}
],
"_meta" : {
"data_type" : "file"
}
}
]
},
...
]
我想在 url 值附加前缀以使其成为绝对路径,同时仅当 _meta 字段 data_type 是文件而不是文本时才从数据库中检索。以上述格式存储,并且仅使用附加的 url 以相同的格式检索。
有没有办法通过使用聚合管道来做到这一点?