Operating Couchbase server 2.5.1 with a bucket view configured like
function (doc, meta) {
if (meta.type == "json" &&
meta.id.indexOf("ExchangeRoomSub:") === 0)
{
emit(meta.id, null);
}
}
in order to present stored documents like
{
"LastCheck": "2015-03-11T07:50:40.0227883Z",
"LastNotification": null,
"FromTicketId": 7388719553030940,
"SigninId": "user@address.com",
"RoomAddress": "room@address.com",
"SubscriptionId": "JwBzaXhwcjAybWIwODc5LmFwY3ByZDAyLnByb2Qub3V0bG9vay5jb20QAAAA4qBzBDolEkSL0fmqe2I6F2smzvQ0KdIIEAAAAALPfNEhdhlMizi0BS2fXRY=",
"LastWatermark": "AQAAABjYlN1rB1hFpRGKcdo4uJUvl8IBAAAAAAA="
}
We interact with Couchbase using .NET SDK v1.3.5, with view extraction code to deserialise the view items via JSON.NET.
public IEnumerable<TEntity> GetView()
{
var view = _CouchBaseClient.GetView(_ViewName, _ViewName);
var items = view.Select(r => r.GetItem());
return items.Select(i => JsonConvert.DeserializeObject<TEntity>(i as string));
}
This works most of the time. Sometimes it appears the item object ends up null.
Value cannot be null.
Parameter name: value
System.ArgumentNullException
Newtonsoft.Json
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at Gumbuya.Services.Core.CouchBaseDiskRepository`1.<GetView>b__7(Object i)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.Count[TSource](IEnumerable`1 source)
Under what condition would a document item turn up null when there is proper value being stored?