RavenDB Query Documents with Property Removed

我的未来我决定 提交于 2019-12-06 13:24:16

An index, with the old property, had to be removed.

** Before ** This didn't work (only returned 66 of the 69 documents):

Session.Query<CustomVariableGroup>().Dump();

** Fix ** Delete index that used the old property that was deleted from my C# class:

In Raven Studio, I deleted this index: Auto/CustomVariableGroups/ByApplicationId

** After ** This same query now returns all 69 documents:

Session.Query<CustomVariableGroup>().Dump();

Now, I'm not sure why these queries would use that index. I'm querying for all CustomVariableGroup documents, and not ByApplicationId. However, removing that index fixed it. I'm sure someone else can explain why.

What do the indexes look like? Did you manually create the indexes or were they dynamically created? Just wondering if that is the cause of the issue based on your comments above that there was a structure change to the object.

--S

Could it be a stale index.. if its not returning all the results you expect.

You could use

.Customize(x=>x.WaitForNonStaleResultsAsOfLastWrite())

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