Hello everyone,
I created 3 different bucket views and now I’m using them like follows:
var myBucket = myCluster.OpenBucket();
var querymain = myBucket.CreateQuery("dev_default", "view_default");
var querypop = myBucket.CreateQuery("dev_default", "view_popular");
var querynew = myBucket.CreateQuery("dev_default", "view_newest");
var result = myBucket.Query<dynamic>(querymain);
var result2 = myBucket.Query<dynamic>(querypop);
var result3 = myBucket.Query<dynamic>(querynew);
Response.Clear();
Response.Write("{ \"HasError\":false,\"Data\":{ \"PopularForums\":[");
foreach (var row2 in result2.Rows)
{
Response.Write(row2.Value);
if (row2 != result2.Rows.ToList().Last())
Response.Write(",");
}
Response.Write("],");
Response.Write("\"NewestForums\":[");
foreach (var row3 in result3.Rows)
{
Response.Write(row3.Value);
if (row3 != result3.Rows.ToList().Last())
Response.Write(",");
}
Response.Write("],");
Response.Write("\"MainForums\":[");
foreach (var row in result.Rows)
{
Response.Write(row.Value);
if (row != result.Rows.ToList().Last())
Response.Write(",");
}
Response.Write("]}}");
Response.End();
I formatted it to make it a proper JSON data. But I have a problem. result.Rows is lists of properties like that :
{
Id: 12,
Title: "Konu Dışı",
Description: "Her şey , hayat, şu, bu, vs",
Parent: 0,
HasChild: false,
Level: 1,
ImageUrl: "http://icon.donanimhaber.com/mobile-forum-icons/12.png",
AvarageColor: null,
RepMode: 0,
MessageCountThisWeek: 30076,
TopicCountThisWeek: 1826
},
I am getting all the data above from couchbase, but I need to use a method I just wrote in .net to get “AvarageColor”. The method needs a data called “iconPath” that is in my couchbase to find the AvarageColor.
How can I do that? I hope I could explain it.
Thanks!