Esempio n. 1
0
        public DbQueryResponse Get()
        {
            Dictionary <string,
                        dynamic> param = new Dictionary <string,
                                                         dynamic> ();

            if (!DbUtils.IsNullObject(this.FieldFilters))
            {
                param["query"] = this.FieldFilters;
            }
            if (DbUtils.IsNullOrEmptyArray(this.FieldOrders))
            {
                param["order"] = this.FieldOrders;
            }
            if (this.LimitCount != 0)
            {
                param["limit"] = this.LimitCount < 1000 ? this.LimitCount: 1000;
            }
            else
            {
                this.LimitCount = 100;
            }
            if (this.Offset != 0)
            {
                param["offset"] = this.Offset;
            }
            if (!DbUtils.IsNullOrEmptyMap(this.Projection))
            {
                param["projection"] = this.Projection;
            }
            DbQueryResponse res = this.QueryRequest <DbQueryResponse> ("database.queryDocument", param);

            return(res);
        }
        public DbQueryResponse Get()
        {
            Dictionary <string, dynamic> query = new Dictionary <string, dynamic>();
            Dictionary <string, dynamic> param = new Dictionary <string, dynamic>();

            query["_id"]        = this.Id;
            param["query"]      = query;
            param["multi"]      = false;
            param["projection"] = this.Projection;

            DbQueryResponse res = this.DocRequest <DbQueryResponse>("database.queryDocument", param);

            return(res);
        }