Document metadata in linq

27 views
Skip to first unread message

Idsa

unread,
Jul 28, 2012, 2:57:05 PM7/28/12
to rav...@googlegroups.com
Document metadata help page contains the following example:

from doc in docs
where doc["@metadata"]["Raven-Entity-Name"] != null
select new { Tag = doc["@metadata"]["Raven-Entity-Name"] };

I didn't manage to make it compilable. What docs is? Is it documentSession.Query<Something>? It doesn't work this way as my entities do not contain indexer. 

Oren Eini (Ayende Rahien)

unread,
Jul 28, 2012, 4:24:08 PM7/28/12
to rav...@googlegroups.com
What do you mean, make it compilable?
Did you run it against the server? What error did you get?

Alexander Sidorov

unread,
Jul 28, 2012, 4:26:14 PM7/28/12
to rav...@googlegroups.com
To run it I need to know what docs is first. I tried to treat docs as documentSession.Query<SomeCollection> and obviously it doesn't build as my entities do not have indexer.

2012/7/29 Oren Eini (Ayende Rahien) <aye...@ayende.com>

Oren Eini (Ayende Rahien)

unread,
Jul 28, 2012, 4:27:30 PM7/28/12
to rav...@googlegroups.com
This is an index that is defined on the server side, or a string on the client side, it is not meant to be compiled client side.

Alexander Sidorov

unread,
Jul 28, 2012, 4:29:07 PM7/28/12
to rav...@googlegroups.com
Oh, sorry, didn't get. So there is no way to treat metadata by dynamic index?

Oren Eini (Ayende Rahien)

unread,
Jul 28, 2012, 4:48:44 PM7/28/12
to rav...@googlegroups.com
There is the MetadayaFor method
Reply all
Reply to author
Forward
0 new messages