[SERVER-8120] mongoexport and count command return different number of records Created: 09/Jan/13 Updated: 10/Dec/14 Resolved: 28/Oct/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | 2.0.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Lynn Hsu | Assignee: | Unassigned |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Linux 64bit |
||
| Operating System: | Linux |
| Participants: |
| Description |
|
We are using mongo shell 2.0.4 We have see something really strange in our mongo collection, which holding roughly 46 million records. When we do "db.CollectionOne.count()" through either mongo shell or java driver, we get 46 million records. However, when we use mongoexport, mongodump to dump ALL the records out, it will have only 43 million records. We even tried the java driver to have a cursor to write out all the records in the db collection, the result is still 43 million, not 46 million. The mongoexport shows the result below. (mongodump shows the same amount of number as mongoexport 43309967) Our mongodb version is 2.0.4 and it is not a shard mongo. It is a replicate set only. The primary has two other replicate member in its group. Did anyone have experienced something like this before? Any suggestion will be very appreciated. Thanks |
| Comments |
| Comment by Stennie Steneker (Inactive) [ 28/Oct/13 ] |
|
Hi Lynn, I'm closing this issue due to inactivity. If you are still seeing this issue (particularly with a newer version of MongoDB, such as 2.4.x) please feel free to open a new issue or comment on this one with the relevant details. Thanks, |
| Comment by Eliot Horowitz (Inactive) [ 10/Jan/13 ] |
|
Can you try mongodump with the --forceTableScan option? |
| Comment by Lynn Hsu [ 09/Jan/13 ] |
|
have one minor correction here. The 46 million is through mongo shell count command only, not the java driver. The java driver report the same amount as the mongexport and mongodump |