yocontra / smog

HTML5/Node/WebSocket MongoDB panel
MIT License
443 stars 42 forks source link

Error parsing document #15

Closed bvarga closed 12 years ago

bvarga commented 12 years ago

can't view the content of a document. It has xml markup, maybe that's the problem, however my driver can read it without problem.

{
  "_id" : ObjectId("5076c2e42450998026000003"),
  "gebtexts" : ["<geb><styles><font index=\"0\" name=\"STIXGeneral\" size=\"12\" color=\"clBlack\" italic=\"false\" bold=\"false\" underline=\"false\"/><font index=\"1\" name=\"Microsoft Sans Serif\" size=\"10\" color=\"clBlack\" italic=\"false\" bold=\"false\" underline=\"false\"/><font index=\"2\" name=\"Microsoft Sans Serif\" size=\"10\" color=\"clBlack\" italic=\"true\" bold=\"false\" underline=\"false\"/><para index=\"0\" lmargin=\"0\" rmargin=\"0\" aspace=\"0\" bspace=\"0\" lspace=\"0\" indent=\"0\" align=\"paLeft\"/></styles><body font=\"0\" para=\"0\"><p><math xmlns=\"http://www.w3.org/1998/Math/MathML\" font=\"1\"><mrow font=\"2\"><mi>Hello</mi></mrow></math></p></body></geb>"],
  "labels" : [],
  "tags" : [],
  "fans" : [],
  "__v" : 0,
  "screenshot" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAAlCAIAAAAyb3uwAAAABnRSTlMA/wD/AP83WBt9AAABJ0lEQVR42u2YyQ7DIAxEw/9/dFqpEooAe2wHgalmDjk4LJ4Xs7Tlvu+LklUISBcBAREQEAEBERBQOkCljFOS4sOW3+csXw5Av4kb1e76W/vIzy5SPCmgJmnpO3v9QGNewykASb3eJPd+cRFQekBw7nBys9ZXakAZyudsQMoWHgbUj7n/mI8BelrtbQcANdPVlvsB6bLsI43twAakIN4MyFs+w3gPyFU+w3id6DxAsFhiIHIBih3w0jZhAaEA0htnBKR/1Srl14mrUv4KEBx/7vo6CZAx0VmAdt6DLHTsgKQjzBtXBjwD0LCjZMYYvwzFshRQfzmU/tAaNrgM+3TsliiNthrQiSIgZImAgCUCApYICFgiIGCJgIAlAlopAgIiICACAiIgoA/j7B7VR4SL9AAAAABJRU5ErkJggg=="
}
yocontra commented 12 years ago

it's new ObjectID(id) not ObjectId(id)

Make sure you're running the latest version AFAIK this has been fixed. I'll reopen if it doesn't work still

yocontra commented 12 years ago

Nvm I can reproduce - fixing now

yocontra commented 12 years ago

Fixed in 0.1.3 - ton was just doing "\"#{string}\"" which is complete backwards. Now it's just JSON.stringify(string) so the escaping applies

bvarga commented 12 years ago

Can confirm, now it works, thanks for the quick fix.