RavenDB: Is there a way to know the actual "Last-Modified" timestamp in slave database

StackOverflow https://stackoverflow.com/questions/20672887

  •  19-09-2022
  •  | 
  •  

Question

I replicate data from RavenDB 1.0 database(master) to RavenDB 2.5 database(slave). The replication is done and I query RavenDB 2.5 database with LastModified by using index "Raven/DocumentsByEntityName". I found that the Last-Modified metadata for all documents are updated to today's date so I have no way to get the correct query result. The Last-Modified metadata for the documents in the original 1.0 DB is a date before today.

Is there any way that I can the real Last-Modified date for the replicated documents? or is there any Created-Timestamp in metadata?

Was it helpful?

Solution

Every time the document is updated, the Last-Modified date is reset. It doesn't matter if you did it yourself, or if it was done via one of Raven's own processes such as replication.

If the dates are important for your domain, you might consider adding properties for them to the document itself.

But if all you're after is a creation date in the metadata, you can add one using a custom bundle. You can write your own, or use the one in the Raven.Contrib project.

But no, Raven doesn't keep a creation date on it's own, so if you've already lost the last-modified date then there's no way to get it back.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top