Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixing RavenDB 270 - won't load the document if we can get all the pr…

…ojection data from the index
  • Loading branch information...
commit a069052a83db7c4c8476f024308a46f62f7e82fa 1 parent 56e0f19
@ayende authored
Showing with 11 additions and 8 deletions.
  1. +11 −8 Raven.Database/Impl/DocumentRetriever.cs
View
19 Raven.Database/Impl/DocumentRetriever.cs
@@ -109,16 +109,19 @@ private JsonDocument ExecuteReadTriggersOnRead(JsonDocument resultingDocument, T
return null;
}
}
- var fieldsToFetchFromDocument = fieldsToFetch.Where(fieldToFetch => queryResult.Projection[fieldToFetch] == null);
- var doc = GetDocumentWithCaching(queryResult.Key);
- if (doc != null)
+ var fieldsToFetchFromDocument = fieldsToFetch.Where(fieldToFetch => queryResult.Projection[fieldToFetch] == null).ToArray();
+ if (fieldsToFetchFromDocument.Length > 0)
{
- var result = doc.DataAsJson.SelectTokenWithRavenSyntax(fieldsToFetchFromDocument.ToArray());
- foreach (var property in result)
+ var doc = GetDocumentWithCaching(queryResult.Key);
+ if (doc != null)
{
- if(property.Value == null || property.Value.Type == JTokenType.Null)
- continue;
- queryResult.Projection[property.Key] = property.Value;
+ var result = doc.DataAsJson.SelectTokenWithRavenSyntax(fieldsToFetchFromDocument.ToArray());
+ foreach (var property in result)
+ {
+ if (property.Value == null || property.Value.Type == JTokenType.Null)
+ continue;
+ queryResult.Projection[property.Key] = property.Value;
+ }
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.