Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RavenDB - LINQ - Count() discrepancies

I am seeing conflicting results using LINQ queries in RavenDB, I am curious as to how the .Count() works exactly.

Query 1:

Session.Query<thisEntity>
.Count()

Result : 205 - meaning I have 205 documents of thisEntity.

Query 2:

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

Result : In LINQ pad this query shows the dump of 197 documents only. I was expecting to see 205 documents

Query 3:

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

Result : 197 - Might mean that there are 197 unique documents and the rest 8 of them are duplicates. This is another thing, there is no way duplicates can be created in our RavenDB instance.

My question: How can I get a dump of those 8 supposedly existing duplicates so I can check clearly what they are. Right now, Count gives me 205, dump gives me only 197. I want to query the db for those extra 8 duplicates.

like image 849
user1258393 Avatar asked Mar 22 '12 02:03

user1258393


1 Answers

Are the documents exactly the same, or are some older versions of the object with missing properties? If so, you may be experiencing the same issue described here.

like image 51
Judah Gabriel Himango Avatar answered Nov 15 '22 07:11

Judah Gabriel Himango