await session.Query<PersistedGrant>() .Where(x => x.SubjectId == subjectId) .ToListAsync() .ConfigureAwait(false);
await session.Query<PersistedGrant>() .Where(x => x.Expiration < DateTimeOffset.UtcNow) .ToListAsync() .ConfigureAwait(false);
from grant in docs.PersistedGrantsselect new { grant.SubjectId, grant.Expiration}
In earlier versions of Raven you could look at how the Auto Index was created but I can't find a way to see it in Raven 4 (at least not in the Studio).
Not sure there's an error in how the index was generated though, because if I reset the auto index from the Studio, it shows the correct number of entries again.
This is a collection that gets written to quite frequently and is cleaned every hour (by the query that queries on ExpirationDate), but that shouldn't really affect how an index behaves, right?
I haven't got a way to reproduce this yet, but I wanted to post here to see if this is something you've encountered before. As soon as I can reproduce, I'll let you know.
//J
Hibernating Rhinos Ltd
Oren Eini l CEO l Mobile: + 972-52-548-6969
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
These are the actual grants documents (2) left in the database after the Token Cleanup did run:
When I query the index, this is the results I get:
Again, the two grants documents repeated...
This is when I query using the raw entries as Oren suggested:
Here are all results unique and the last two entries are the two grants documents that exists in the db, the rest are grants that got removed.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
------------------------------------------------------------------------------------------------------------------------
RavenDB 4 - 4.0.0-rc-40023 - Community License settings.json
{
"ServerUrl": "http://localhost:4040",
"DataDir": "APPDRIVE:/Raven",
"Indexing": {
"TimeToWaitBeforeMarkingAutoIndexAsIdleInMin": 1
},
"RunInMemory": false
}
To reproduce: Create a database called: `Raven.Index.Debug` Start the WebAPI (not sure it actually need to be a Web Application, but that's what our application that have this issue is so). It will run `PopulateData(...)` on startup to populate two document collections (TestDocument that uses an IdConvention and AnotherTestDocument that doesn't) with 20 documents each. One auto index for each Document Collection will also be created. 1. Open Raven Studio and look at the index list, both indexes should show "20 entries". 2. Remove a couple of documents manually from each collection, and look at the index list again. It will show the new number of entries correctly. 3. Stop the Web Application (could also remove the PopulateData call inside the Startup to prevent it from repopulating again) and also, close the Raven Studio (not sure this is needed) 4. Wait... I had to wait between 20-30 minutes for the issue to actually happen. 5. Open Raven Studio and look at the index list again, they will still show "X entries" (depending on how many documents you removed in step 2). 6. Manually remove a couple of documents from each collection again and look at the index list. This time it doesn't always decrement the # of entries. If it does, you probably didn't wait long enough in step 4... 7. Remove ALL documents from the collections and look at the index list again. Here it might differ, but for my latest attempt, the # of entries updated to "7 entries" and "1 entry" Now, you can start the Web Application again (be sure to remove the call to PopulateData(...)). You can do the following requests: GET: http://localhost:8802/api/anotherTestDocuments My result: ``` { "numberOfActualResults": 0, "stats": { "isStale": false, "durationInMs": 0, "totalResults": 7, "skippedResults": 7, "timestamp": "2017-12-07T11:18:58.3316286", "indexName": "Auto/AnotherTestDocuments/ByCreated", "indexTimestamp": "2017-12-07T11:18:58.3316286", "lastQueryTime": "2017-12-07T11:20:19.8947196", "timingsInMs": {}, "resultEtag": 4441579847025080415, "resultSize": 0, "scoreExplanations": {} } } ``` The numberOfActualResults is the Count of the actual query result, and the stats is what the .Statistics(...) is producing. You can also do a GET: http://localhost:8802/api/testDocuments and get a similar result.
------------------------------------------------------------------------------------------------------------------------
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
Hibernating Rhinos Ltd
Tal Weiss l Core Team Developer l Mobile:+972-54-802-4849
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811l Skype: talweiss1982
RavenDB paving the way to "Data Made Simple" http://ravendb.net/
Hibernating Rhinos Ltd
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.