RavenDB - LINQ - Count () Inconsistencies

I see conflicting results with LINQ queries in RavenDB, I'm curious how exactly .Count () works exactly.

Request 1:

Session.Query<thisEntity> .Count() 

Result: 205 - this means that I have 205 documents of this Entity.

Request 2:

 Session.Query<thisEntity> .Take(210) .Dump() 

Result: in the LINQ panel, this query shows only a dump of 197 documents. I expected to see 205 documents

Request 3:

 Session.Query<thisEntity> .Distinct() .Count() 

Result: 197 - It may mean that there are 197 unique documents and the remaining 8 of them are duplicates. Another thing is that in our instance of RavenDB you cannot create duplicates.

My question is: how can I get a dump from these supposedly existing duplicates so that I can clearly verify what it is. Right now, the graph gives me 205, the dump gives me just 197. I want to request db for these extra 8 duplicates.

+6
source share
1 answer

Are the documents the same or are older versions of the object with missing properties? If so, you may encounter the same problem described here .

+1
source

Source: https://habr.com/ru/post/911372/


All Articles