1

I have a RavenDB with some collections and about 30 indexes.

I'm trying to perform some mass updates in a specific collection (Profiles) via DatabaseCommands.UpdateByIndex and a PatchRequest, actually my code is something like this:

db.DatabaseCommands.UpdateByIndex("Profiles/ByFinder",  new
    Raven.Abstractions.Data.IndexQuery {  },    new [] { new PatchRequest {
    Type = PatchCommandType.Unset, Name = "CreatedById" } });

Where "Profiles/ByFinder" is an index that works on this specific collection.

The strange thing is that ALL the indexes in the DB go in stale state as I perform this command, even the indexes that don't work with the Profiles collection in any way.

Is that the default behaviour, and if so, there's a way to avoid it?

DanielV
  • 2,076
  • 2
  • 40
  • 61
tanathos
  • 5,566
  • 4
  • 34
  • 46

1 Answers1

2

That is by design, whenever you modify a document, all documents are stale until they can verify that this document isn't related to them.

Ayende Rahien
  • 22,925
  • 1
  • 36
  • 41
  • 1
    Thanks for the reply Ayende, the example I posted is trivial, but what is the suggested way to manage, for example, the update of denormalized references in the other documents WITHOUT the use of patch requests? – tanathos Nov 28 '14 at 10:49