我有一個查詢問題我想不通,我在做這個查詢代碼:Ravendb 2.5:查詢得到0的結果,而應該是1
var userList = (from user in this.documentSession.Query<User>()
where user.FederatedUserIds[authenticatedClient.ProviderName] == authenticatedClient.UserInformation.Id
select user).ToList();
在這種情況下, providername是Facebook,id = 100001103765630. FederatedUserId是一個字典。
導致此查詢到服務器:
http://localhost:8080/indexes/dynamic/Users?&query=FederatedUserIds.facebook%3A100001103765630&pageSize=128
其中給出零分的結果,也從web瀏覽器的查詢:
{
"Results": [],
"Includes": [],
"IsStale": false,
"IndexTimestamp": "2013-08-24T14:52:44.0511623Z",
"TotalResults": 0,
"SkippedResults": 0,
"IndexName": "Auto/Users/ByFederatedUserIds_facebook",
"IndexEtag": "01000000-0000-0064-0000-000000000001",
"ResultEtag": "2BD9AA1E-935A-FEDF-3636-FAB0F155ED9E",
"Highlightings": {},
"NonAuthoritativeInformation": false,
"LastQueryTime": "2013-08-24T15:00:30.1200358Z",
"DurationMilliseconds": 1
}
雖然我有一個文件,就是這樣的數據庫,所以我期望1結果,而不是0:
{
"DisplayName": "neographikal",
"RealName": "x",
"Email": "x",
"PictureUri": "x",
"Roles": [
"User"
],
"ProfileImages": [],
"FederatedUserIds": {
"google": "x",
"twitter": "x",
"windowslive": "x",
"linkedin": "x",
"facebook": "100001103765630"
}
}
奇怪的是,這有這段代碼之前從來沒有打擾過我。有人可以看到我在做什麼錯嗎?
確實看起來很奇怪。如果您發現其他問題,請告訴我們。 –
它又發生在我身上。刪除索引並重新啓動應用程序修復了它。仍然無法弄清楚它爲什麼會發生。 – neographikal