Eystein Bye
Eystein Bye

Reputation: 5126

Get ID from Ravendb query

I am using the clientAPI to query an index (Cards) in RavenDB so:

Dim cards = Raven.CurrentSession.Query(Of Cards)("Cards").ToArray()

This works well and returns all the documents, but how can I get the ID of the documents it returns?

Upvotes: 4

Views: 544

Answers (1)

Ayende Rahien
Ayende Rahien

Reputation: 22956

Eystein,

for each of the returned cards, you do

Raven.CurrentSession.Advanced.GetDocumentId(card)

Upvotes: 3

Related Questions