[CSHARP-1812] MongoCollection.Count() is not correct Created: 26/Oct/16 Updated: 22/Dec/16 Resolved: 22/Dec/16 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Operations |
| Affects Version/s: | 2.4.0-beta1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Hu | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
var cursor = mongoCol.FindAllAs<BsonDocument>() the SkipCnt and LimitCnt is 0. var dataList = cursor.ToList(); var CurrentCollectionTotalCnt = (int)mongoCol.Count(); //CurrentCollectionTotalCnt is 1 //Test Record is below /* 1 */ , , , , |
| Comments |
| Comment by Hu [ 27/Oct/16 ] | |||||||||||||||||||||||||||||||||||||||
|
https://jira.mongodb.org/browse/SERVER-26802 | |||||||||||||||||||||||||||||||||||||||
| Comment by Hu [ 27/Oct/16 ] | |||||||||||||||||||||||||||||||||||||||
|
HardCopy of this issue: | |||||||||||||||||||||||||||||||||||||||
| Comment by Hu [ 27/Oct/16 ] | |||||||||||||||||||||||||||||||||||||||
|
Really,If I use your code,the count is correct. MongoBooster/places has 2 record,but result is 1. | |||||||||||||||||||||||||||||||||||||||
| Comment by Robert Stam [ 26/Oct/16 ] | |||||||||||||||||||||||||||||||||||||||
|
I am unable to reproduce this. Using the following standalone test program both documentCount and collectionCount are equal to 2.
| |||||||||||||||||||||||||||||||||||||||
| Comment by Hu [ 26/Oct/16 ] | |||||||||||||||||||||||||||||||||||||||
|
DB:MongoDB 3.4 RC1 I found that MongoBooster(a mongo admin tool) has the same bug. |