RavenDb学习(十)附件,存储大对象
生活随笔
收集整理的這篇文章主要介紹了
RavenDb学习(十)附件,存储大对象
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
1、讀取
Raven.Abstractions.Data.Attachment attachment = documentStore.DatabaseCommands.GetAttachment("videos/1");2、存儲(chǔ)、更新
Stream data = new MemoryStream(new byte[] { 1, 2, 3 }); // don't forget to load the data from a file or something!
documentStore.DatabaseCommands.PutAttachment("videos/2", null, data,new RavenJObject {{"Description", "Kids play in the garden"}});3、刪除附件
documentStore.DatabaseCommands.DeleteAttachment("videos/1", null);4、讀取元數(shù)據(jù)
Raven.Abstractions.Data.Attachment attachmentMetadata = documentStore.DatabaseCommands.HeadAttachment("Description");5、更新元數(shù)據(jù)
documentStore.DatabaseCommands.UpdateAttachmentMetadata("videos/1", null, new RavenJObject{{ "Description", "Kids play in the bathroom" }});
?
總結(jié)
以上是生活随笔為你收集整理的RavenDb学习(十)附件,存储大对象的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: CDN(内容分发网络)技术原理(转)
- 下一篇: Socket网络协议之一