English 中文(简体)
Updating documents in RavenDB
原标题:
  • 时间:2010-06-25 12:30:03
  •  标签:
  • ravendb

If you add, delete or rename a property on a persisted entity, what s the easiest way to update the documents in RavenDB?

最佳回答

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();




相关问题
RavenDB: Grammatical and phonetical analysis?

I m a little confused about the level of integration between Lucene.NET and RavenDB. Lucene supports grammatical and phonetical analysis of texts (like word stemming, Metaphone) to allow searches ...

RavenDB: Id Generation For Sub-Documents

I m trying migrating an existing web application to use RavenDB. I currently have pages in my web application which allow you to view Categories, SubCategories and Resources based on an id in the ...

Updating documents in RavenDB

If you add, delete or rename a property on a persisted entity, what s the easiest way to update the documents in RavenDB?

Lucene Boolean Query on Not ANalyzed Fields

Using RavenDB to do a query on Lucene Index. This query parses okay: X:[[a]] AND Y:[[b]] AND Z:[[c]] However this query gives me a parse exception: X:[[a]] AND Y:[[b]] AND Z:[[c]] AND P:[[d]] "...

.Net Finalizer Order / Semantics in Esent and Ravendb

Help me understand. I ve read that "The time and order of execution of finalizers cannot be predicted or pre-determined" Correct? However looking at RavenDB source code TransactionStorage.cs I see ...

热门标签