RavenDB multi map

大兔子大兔子 提交于 2019-12-20 03:24:21

问题


I have a DB containing many tables, and every table has different properties, and I want to achive the following:

Create and index on all of the properties (from every table).

The problem is that I don't have a class for every table for I have used dynamic classes to insert them to the DB.

So how can I create an index that given a string will return all documents that one of their properties contains that string?

Another problem needed to be solved is that in future Tables insertion I can add the new table to the index I explained above.

Thanks, David


回答1:


David, You don't have tables in RavenDB, but that aside, you can just define an index over the entire data set, like this:

     from doc in docs select new { doc.Name }

Which will define an index over all types, allowing you to query over all the documents' names.



来源:https://stackoverflow.com/questions/11073667/ravendb-multi-map

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!