What? You don’t have an Id property on your model classes?
Can you please show us your classes which you store inside raven.
Believe me, there must be an Id property on your data classes that you persist in RavenDB. That’s simply the way it works.
Please refer to the documentation here to learn more about document ids: http://ravendb.net/docs/client-api/basic-operations/saving-new-document#document-ids
From: rav...@googlegroups.com [mailto:rav...@googlegroups.com]
On Behalf Of Nicolas Spontz
Sent: Mittwoch, 2. Mai 2012 20:33
To: rav...@googlegroups.com
Subject: Re: [RavenDB] how to retrieve id's of documents along with the documents themselves in RavenBD
I am ready to do whatever tweak, including wrapper or whatnot.
Look, may be you are right, but that would be just wrong. I can't believe this would be the case.
Ok,… now I understand what you meant.
You can use this:
var metadata = session.Advanced.GetMetadataFor(yourObject);
var id = metadata["@id"];
However, I would suggest to add an Id property to your class because it’s always easier.
From: rav...@googlegroups.com [mailto:rav...@googlegroups.com]
On Behalf Of Nicolas Spontz
Sent: Mittwoch, 2. Mai 2012 20:45
To: rav...@googlegroups.com
Subject: Re: [RavenDB] how to retrieve id's of documents along with the documents themselves in RavenBD
Aren't you confounding the notion of
Uhm? How can a document not have an Id???
The corrallary to this is you lose the ability to create meaningful document keys like "users/1/profile" "users/1/shoppingcart". I found myself needing the hilo key generator almost never anymore because all of my documents generally can have semantic meaning. Some of this relates to your domain.
Beyers, you probably want to look at this: http://ayende.com/blog/153704/composite-entities
From: rav...@googlegroups.com [mailto:rav...@googlegroups.com]
On Behalf Of Beyers
Sent: Mittwoch, 02. Mai 2012 23:49
To: rav...@googlegroups.com
Subject: Re: [RavenDB] how to retrieve id's of documents along with the documents themselves in RavenBD
Chris,
Storing, loading, and transferring over the wire, data that isn't
needed to get the job done runs counter to my basic sensibilities and
would actually require more mental work on my part.
If I need to make an educated guess I would say that there is no eady way of having ravendb generate those ids automatically. Anyway I don’t really see the problem of appending something like “/billing” to an existing id? You can still let ravendb generate the base id like “users/1” and then have your composite it appended like “users/1/billing”, right?
From: rav...@googlegroups.com [mailto:rav...@googlegroups.com]
On Behalf Of Beyers Cronje
Sent: Donnerstag, 03. Mai 2012 00:17
To: rav...@googlegroups.com
Subject: Re: [RavenDB] how to retrieve id's of documents along with the documents themselves in RavenBD
Thanks Daniel,
Before I'd string together the Ids of all of an object's ancestors as
you're doing with that Task object, I'd have them as individual
properties of the Task object.