localprojects / Civil-Debate-Wall

http://www.civildebatewall.com/
7 stars 3 forks source link

Invalid category data sometimes #3

Open cybertoast opened 12 years ago

cybertoast commented 12 years ago

In some instances questions have:

"category" : DBRef("category", "[object Object]"),

but it should really be something more like:

"category" : DBRef("category", ObjectId("4e56af45714375eb670000e3")),

This may be due to accessing the record via MongoHQ (or maybe not). This causes all sorts of havoc. In order to correct this, do the following:

db.question.update({_id: <question-id)}, {$set: {'category': {$ref: 'category', $id: ObjectId('4e56af45714375eb670000e3')}}})

Obviously change the category to the correct ID on your system!