foreach (var timeRecord in timeRecords)
{
// session.Store(timeRecord);
var metadata = session.Advanced.GetMetadataFor(timeRecord);
var oldId = metadata["@id"].ToString();
var newId = oldId.Replace("TimeRecords", "CostRecords");
metadata["@collection"] = "CostRecords";
metadata["Raven-Clr-Type"] = "MyNamespace.TimeRecords.Persistence.CostRecord, MyNamespace"; metadata["@id"] = newId;
....
....
// then put / delete![]() | Grisha Kotler Team Leader / Hibernating Rhinos LTD
|
--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
To post to this group, send email to rav...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/2b023ab9-eee6-431a-8582-343c82c473c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to rav...@googlegroups.com.
![]() | Grisha Kotler Team Leader / Hibernating Rhinos LTD
|
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
To post to this group, send email to rav...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/ac9a34c2-4f22-46a7-a6b4-d2c92d15ba7d%40googlegroups.com.
Is there a way to do all the four steps on the server-side? There are commands to GET, PUT and DELETE, but it seems they'll require loading each item to the client.
![]() | Grisha Kotler Team Leader / Hibernating Rhinos LTD
|
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
To post to this group, send email to rav...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/34a4c126-02c1-4701-adde-37ab6a00d508%40googlegroups.com.
Hi Aleksander,You can do that by running a server-side patch.The script below will change the collection name:from Orders
update {
var documentId = id(this);
del(documentId);
// change other properties in the document (you'll probably need to clone the document in order to do that).
this["@metadata"]["@collection"] = "New-Orders";
put(documentId, this);
}
Grisha Kotler
Team Leader / Hibernating Rhinos LTD
Mobile: +972-54-586-8647 Sales: sa...@ravendb.net
Skype: grisha.kotler Support: sup...@ravendb.net
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/00df1bca-4825-4f35-8394-ea34941dfee0%40googlegroups.com.
![]() | Oren Eini CEO / Hibernating Rhinos LTD
|
The hilo records contain a document per collection, you can just remove the entry for the old record, no?
To unsubscribe from this group and stop receiving emails from it, send an email to rav...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/00df1bca-4825-4f35-8394-ea34941dfee0%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/ebe50341-3f0d-4a20-aee1-23dd42b73941%40googlegroups.com.
Oh, you can just create a document with the same structure but a different id, and it will work
To unsubscribe from this group and stop receiving emails from it, send an email to rav...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/ebe50341-3f0d-4a20-aee1-23dd42b73941%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/43f27955-d52a-4ec2-b4de-86309baafd98%40googlegroups.com.
Set the metadata yourself, it won't do that on its own
To unsubscribe from this group and stop receiving emails from it, send an email to rav...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/43f27955-d52a-4ec2-b4de-86309baafd98%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ravendb/a5e9cfb8-0ed7-4be7-ad5a-20f2e3090ead%40googlegroups.com.