Add fields while storing objects...

26 views
Skip to first unread message

Russ McClelland

unread,
Jun 12, 2017, 9:16:45 AM6/12/17
to RavenDB - 2nd generation document database
I'd like to be able to add a couple of fields to an object in the json that is stored by Raven, and then strip them out when reading. Are "transformations" the way to do this? Or is there a better/simpler way?

Oren Eini (Ayende Rahien)

unread,
Jun 12, 2017, 9:24:06 AM6/12/17
to ravendb

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


On Mon, Jun 12, 2017 at 4:14 PM, Russ McClelland <russ.mc...@gmail.com> wrote:
I'd like to be able to add a couple of fields to an object in the json that is stored by Raven, and then strip them out when reading. Are "transformations" the way to do this? Or is there a better/simpler way?

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Russ McClelland

unread,
Jun 12, 2017, 11:14:55 AM6/12/17
to RavenDB - 2nd generation document database
Thanks! That looks like what I needed.


On Monday, June 12, 2017 at 8:24:06 AM UTC-5, Oren Eini wrote:

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 


On Mon, Jun 12, 2017 at 4:14 PM, Russ McClelland <russ.mc...@gmail.com> wrote:
I'd like to be able to add a couple of fields to an object in the json that is stored by Raven, and then strip them out when reading. Are "transformations" the way to do this? Or is there a better/simpler way?

--
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.

Kijana Woodard

unread,
Jun 13, 2017, 9:05:41 AM6/13/17
to rav...@googlegroups.com
@Russ - regarding stripping them out on read - if your document class doesn't have them they are "gone" from the pov of your code. Was there some other reason to strip them?

To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.

Russ McClelland

unread,
Jun 23, 2017, 4:39:19 PM6/23/17
to RavenDB - 2nd generation document database
Probably not, I just didn't know if they would cause the reader to stop if it encountered a property that wasn't part of the Type being created... What you said makes perfect sense from a backwards compatibility perspective: it would have to ignore those instead of throwing an exception.
Reply all
Reply to author
Forward
0 new messages