MultiGet operation is missing first item in the key list

I have the following method that always returns results without the first element in the
List keys. I stepped through the source code of the client and was able to trace
it to CORRELATIONID in the header always returns SECOND ITEM in the key array
upon reading from the socket.

Can anyone confirm/deny this?

public List GetUrlList(string startKey = null, string endKey = null, int limit = 0)
{
if (limit > 100)
limit = 100;

var view = NoSqlClient.GetView("url", "urllist");
if (limit > 0) view.Limit(limit);
if (!string.IsNullOrEmpty(startKey)) view.StartKey(startKey);
if (!string.IsNullOrEmpty(endKey)) view.EndKey(endKey);
view.Descending(true);

var viewResult = view.ToList();

List keys = new List();

// addgin results to a list for multiget retrieval
foreach (var row in viewResult)
keys.Add(row.ViewKey[0].ToString());

// Using multiget to retrieve all items
var results = NoSqlClient.Get(keys);

List urlList = new List();
foreach (var item in results)
{

var json = item.Value.ToString();
if (!String.IsNullOrEmpty(json))
{
var url = JsonConvert.DeserializeObject(json);
if(url != null)
urlList.Add(url);
}
}

return urlList;
}

0 Answers

No answers yet