Google Groups

Re: [RavenDB] Document ID issue during bulk insert of 2M documents with subsequent patching

Oren Eini Jul 27, 2012 9:21 AM
Posted in group: RavenDB - 2nd generation document database
1) Keep a side document with the mapping, so you can easily do a load by id, something like:

"references/data/2012/07/27/js9am2ms8la91" - { "DocId": "data/1"}

2) It isn't exposed to the client API.


On Fri, Jul 27, 2012 at 7:16 PM, Tobias Sebring <> wrote:
I'm using RavenDb to do bulk inserts from a large datadump similar to the process outlined by Ayende here: My problem is that unlike the Stackoverflow datadump where Ayende utilizes the userId for document IDs, the datadump I'm working with is using complex string IDs that I would prefer to not use for my document IDs. With indexing turned off and auto generated document IDs - I do not know how to load the inserted documents for patching.

Example process:
foreach data in datas
    session.Store(new Data { Id = "data/1", DatadumpKey = "/data/2012/07/27/js9am2ms8la91" })

foreach part in parts
   var data = session.Query<Data>().SingleOrDefault(p => p.DatadumpKey == part.DatadumpKey); //this does not work since there is no index, and with indexes enabled it will always be stale.
   data.Parts.Add(new Part { ... }));

1. What's the recommended solution to the issue explained above?
2. Is it possible to disable indexing from the client API rather than through HTTP?
3. What's the best way to export the new database and import it (overwrite) onto a production server in order to keep the downtime as low as possible?