public async Task <bool> UpdateAsync(string requestPath, Stream stream) { var collection = _getCollection(requestPath); using var reader = new StreamReader(stream, Encoding.UTF8); var jsonString = await reader.ReadToEndAsync(); return(await Task.Run(() => PonyWriteEntity.Parse(jsonString).Update(collection))); }
public async Task <JObject> StoreAsync(string requestPath, Stream stream) { var collection = _getCollection(requestPath); using var reader = new StreamReader(stream, Encoding.UTF8); var jsonString = await reader.ReadToEndAsync(); var bsonDocument = await Task.Run(() => PonyWriteEntity.Parse(jsonString).Save(collection)); return(bsonDocument.ToJson()); }