コード例 #1
0
        public override CBDocument this[int i]
        {
            get {
                var val = enumerator != null?enumerator.GetRow(i).Document : null;

                return(val);
            }
        }
コード例 #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
                      ());
        }
コード例 #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);
 }
コード例 #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);
        }
コード例 #5
0
 public override long GetItemId(int i)
 {
     return(enumerator.GetRow(i).SequenceNumber);
 }
コード例 #6
0
 public virtual QueryRow RowAtIndex(int index)
 {
     return(Rows.GetRow(index));
 }
コード例 #7
0
 public override Java.Lang.Object GetItem(int i)
 {
     return((Java.Lang.Object)enumerator.GetRow(i).Document);
 }