Updating documents in RavenDB

为君一笑 提交于 2019-12-04 22:57:53
Matt Warren

RavenDB supports PATCH commands, see the docs for more info for more info. This way you can update a document directly without having to pull it from the server, update it and then send it back.

Also you can run patches over multiple documents by using Set-based queries, see here for some more info. This lets you do the equivalent of

UPDATE Users
SET IsActive = false
WHERE LastLogin < '2010-05-10'

raven also has object tracking. so the following works:

var doc = _session.Load<MyDocType>(docId);
doc.PropertyToChange = "New Value";
_session.SaveChanges();
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!