public override CBDocument this[int i] { get { var val = enumerator != null?enumerator.GetRow(i).Document : null; return(val); } }
/// <exception cref="Couchbase.Lite.CouchbaseLiteException"></exception> public virtual void TestViewReducePerformance() { long startMillis = Runtime.CurrentTimeMillis(); Query query = database.GetView("vacant").CreateQuery(); query.SetMapOnly(false); QueryEnumerator rowEnum = query.Run(); QueryRow row = rowEnum.GetRow(0); Log.V("PerformanceStats", Tag + ":testViewReducePerformance," + Sharpen.Extensions.ValueOf (Runtime.CurrentTimeMillis() - startMillis).ToString() + "," + GetNumberOfDocuments ()); }
public static Couchbase.Lite.Document GetUserProfileById(Database database, string userId) { Couchbase.Lite.Document profile = null; try { QueryEnumerator enumerator = Profile.GetQueryById(database, userId).Run(); profile = enumerator != null && enumerator.GetCount() > 0 ? enumerator.GetRow(0). GetDocument() : null; } catch (CouchbaseLiteException) { } return(profile); }
private string GetCurrentListId() { var application = (CouchbaseSample.Android.Application)Application; string currentListId = application.GetCurrentListId(); if (currentListId == null) { try { QueryEnumerator enumerator = List.GetQuery(GetDatabase()).Run(); if (enumerator.Count() > 0) { currentListId = enumerator.GetRow(0).Document.Id; } } catch (CouchbaseLiteException) { } } return(currentListId); }
public override long GetItemId(int i) { return(enumerator.GetRow(i).SequenceNumber); }
public virtual QueryRow RowAtIndex(int index) { return(Rows.GetRow(index)); }
public override Java.Lang.Object GetItem(int i) { return((Java.Lang.Object)enumerator.GetRow(i).Document); }