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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With