コード例 #1
0
ファイル: update.cs プロジェクト: ado5/cloudbase-dotnet-sdk
        public JObject ToJSON()
        {
            JObject jsonMap = new JObject();

            jsonMap["_actions"] = (JArray)(Serializer.EncodeData(this.Actions));
            return(jsonMap);
        }
コード例 #2
0
        public DbCreateResponse Create(object data)
        {
            JObject dataJson = (JObject)(Serializer.EncodeData(data));
            Dictionary <string, dynamic> param = new Dictionary <string, dynamic>();

            param["data"] = dataJson;
            if (!DbUtils.IsNullOrEmptyString(this.Id))
            {
                param["_id"] = this.Id;
            }

            DbCreateResponse res = this.DocRequest <DbCreateResponse>("database.addDocument", param);

            return(res);
        }
コード例 #3
0
        public DbUpdateResponse Update(object data)
        {
            JObject dataJson = (JObject)(Serializer.EncodeData(data));
            Dictionary <string, dynamic> param = new Dictionary <string, dynamic>();

            param["query"]  = this.FieldFilters;
            param["muti"]   = true;
            param["merge"]  = true;
            param["upsert"] = false;
            param["data"]   = dataJson;
            param["interfaceCallSource"] = "BATCH_UPDATE_DOC";

            DbUpdateResponse res = this.QueryRequest <DbUpdateResponse>("database.updateDocument", param);

            return(res);
        }
コード例 #4
0
        public DbUpdateResponse Update(object data)
        {
            JObject dataJson = (JObject)(Serializer.EncodeData(data));
            Dictionary <string, dynamic> query = new Dictionary <string, dynamic>();
            Dictionary <string, dynamic> param = new Dictionary <string, dynamic>();

            query["_id"]    = this.Id;
            param["query"]  = query;
            param["data"]   = dataJson;
            param["multi"]  = false;
            param["merge"]  = true;
            param["upsert"] = false;
            param["interfaceCallSource"] = "SINGLE_UPDATE_DOC";

            DbUpdateResponse res = this.DocRequest <DbUpdateResponse>("database.updateDocument", param);

            return(res);
        }
コード例 #5
0
        public Query Where(object query)
        {
            JObject queryJson = (JObject)(Serializer.EncodeData(query));

            return(new Query(this.Core, this.Coll, queryJson, this.FieldOrders, this.LimitCount, this.Offset, this.Projection));
        }