6

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.

1
  • 1
    I thing this is more to do with the fact that internally RavenDB does different things when you issue a query with/without a page size. It may be a bug, can you post a full code sample that shows the problem? Mar 22, 2012 at 12:04

1 Answer 1

1

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.

1
  • The documents are exactly the same. The structure has not changed. Mar 22, 2012 at 13:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.