admin管理员组文章数量:1279175
I want to get the parameters interest.name, interest.description, interest.category.name as String with the value that is currently returning a list. They are translations and I select the value depending the code with the code .eq('...',languageCode)
that I show below
Is there a way to do this in supabase?
this is my json at the moment:
{
"id":"f36686d7-f815-4372-aba8-4d3f7fe1a4a5",
"member_id":"c2579821-54e4-42c8-8b35-b522a34712a2",
"interest_id":"yoga",
"interest":{
"id":"yoga",
"name":[
{
"name":"Yoga",
}
],
"active":true,
"category":{
"id":"fitness",
"icon":"meditation",
"name":[
{
"name":"Fitness"
}
],
"color":"primary200",
"active":true,
},
"category_id":"fitness",
"description":[
{
"description":"Physical activity focused on poses and meditation."
},
{
"description":"Actividad física basada en posturas y meditación."
}
],
"interest_type_id":"fitness"
}
}
This is the code of the query:
var query = _supabaseClient.from('member_interests').select('''
*,
interest:interest_id(
*,
category:category_id(
*,
name: category_translations(name)
),
name: interest_translations(name),
description: interest_translations(description)
)
''').eq('member_id', memberId);
if (languageCode != null) {
query = query.eq(
'interest.interest_translations.language_code',
languageCode,
);
query = query.eq(
'interest.category.category_translations.language_code',
languageCode,
);
}
final data = await query;
return data.map(MemberInterest.fromJson).toList();
}
本文标签: dartSupabase query return string instead of listStack Overflow
版权声明:本文标题:dart - Supabase query return string instead of list - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741301825a2371131.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论