[SERVER-14976] Ghost Documents Created: 20/Aug/14  Updated: 10/Dec/14  Resolved: 20/Aug/14

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Oliver Yeh Assignee: Ramon Fernandez Marina
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-5290 fail to insert docs with fields too l... Closed
Operating System: ALL
Participants:

 Comments   
Comment by Ramon Fernandez Marina [ 20/Aug/14 ]

yeho, this is indeed SERVER-5290, so the behavior you observe is expected. The _id of a document cannot be changed anyway, so you'll need to recreate the affected documents manually.

One way to clean up your data could be to insert an additional field temporarily:

db.apples.update({"_id": {$type: 2}}, {$set : {valid : 1}})
db.apples.update({valid : null}, {$set : {valid : 0}})

and then query for documents where {valid : 0}.

You may also want to know about the failIndexKeyTooLong parameter for MongoDB 2.6

Regards,
Ramón.

Comment by Oliver Yeh [ 20/Aug/14 ]

2.6.3. I recently upgraded from 2.4.8. I do have keys that are longer than 1024 characters and I am trying to delete it to cleanup the database but I can't query for them.

Also, is there any way to edit the details of this bug report? I pressed "Create Issue" too soon before completing the necessary details. Now I can only add comments.

Comment by Ramon Fernandez Marina [ 20/Aug/14 ]

Hi yeho, do you have documents with keys longer that 1024 characters? Can you send us a dump of your database? What version of MongoDB are you using?

Comment by Oliver Yeh [ 20/Aug/14 ]

> db.apples.find({"_id": {$type: 1}}).count() => 0
> db.apples.find({"_id": {$type: 2}}).count() => 100
> db.apples.find({"_id": {$type: 3}}).count() => 0
> db.apples.find({"_id": {$type: 4}}).count() => 0
> db.apples.find({"_id": {$type: 5}}).count() => 0
> db.apples.find({"_id": {$type: 6}}).count() => 0
> db.apples.find({"_id": {$type: 7}}).count() => 0
> db.apples.find({"_id": {$type: 8}}).count() => 0
> db.apples.find({"_id": {$type: 9}}).count() => 0
> db.apples.find({"_id": {$type: 10}}).count() => 0
> db.apples.find({"_id": {$type: 11}}).count() => 0
> db.apples.find({"_id": {$type: 12}}).count() => 0
> db.apples.find({"_id": {$type: 13}}).count() => 0
> db.apples.find({"_id": {$type: 14}}).count() => 0
> db.apples.find({"_id": {$type: 15}}).count() => 0
> db.apples.find({"_id": {$type: 16}}).count() => 0
> db.apples.find({"_id": {$type: 17}}).count() => 0
> db.apples.find({"_id": {$type: 18}}).count() => 0
> db.apples.count() => 105

> db.apples.find({"_id": {$exists: false}}).count() => 0
> db.apples.find({"_id": {$exists: true}}).count() => 100
> db.apples.find().count() => 105

I believe this is related to https://jira.mongodb.org/browse/SERVER-5290

Generated at Thu Feb 08 03:36:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.