Ejemplo n.º 1
0
        public override CBDocument this[int i]
        {
            get {
                var val = enumerator != null?enumerator.GetRow(i).Document : null;

                return(val);
            }
        }
Ejemplo n.º 2
0
        /// <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
                      ());
        }
Ejemplo n.º 3
0
 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);
 }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 public override long GetItemId(int i)
 {
     return(enumerator.GetRow(i).SequenceNumber);
 }
 public virtual QueryRow RowAtIndex(int index)
 {
     return(Rows.GetRow(index));
 }
Ejemplo n.º 7
0
 public override Java.Lang.Object GetItem(int i)
 {
     return((Java.Lang.Object)enumerator.GetRow(i).Document);
 }