public JObject ToJSON() { JObject jsonMap = new JObject(); jsonMap["_actions"] = (JArray)(Serializer.EncodeData(this.Actions)); return(jsonMap); }
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); }
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); }
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); }
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)); }