yocontra / smog

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

Error retrieving documents: [object Object] #5

Closed SeanBannister closed 11 years ago

SeanBannister commented 12 years ago

I'm running Node v0.8.9 and when I connect to a database it lists the collections in the database but clicking on one returns the error "Error retrieving documents: [object Object]" at the bottom of the screen

yocontra commented 12 years ago

Are you still getting this issue with the latest version?

SeanBannister commented 12 years ago

Unfortunatley I haven't been able to check as I'm getting an install error with the new version https://github.com/wearefractal/smog/issues/12

SeanBannister commented 12 years ago

So while I'm having permissions issues installing globally I was still able to install into my users home directory and run smog from the bin directory. When I pull up the web interface I get a "connect" dialogue with mongodb://localhost:27017/test?auto_reconnect I change test to my database name and it logs in and shows me the collections, however when I click on the collection name it doesn't show me any documents its just blank. And the Javascript console doesn't return any errors.

yocontra commented 12 years ago

Do your collections have documents in them? Can you pull up their metadata it's possible I might not be accounting for some collection properties when querying. In smog find({}) is run on a collection to grab the docs

SeanBannister commented 12 years ago

When you say "Can you pull up their metadata" do you mean "can I see it in smog"? I'm not sure where it should show but no I'm not seeing it.

I just tried adding a new collection and that works fine, then I added a document to it and it shows up. But existing tables don't show there data.

yocontra commented 12 years ago

I meant via the mongo console can you pull up data about the collection (tailable=(true,false) etc.) - can you give me an example document stored in one of these collections?

SeanBannister commented 12 years ago

One of the documents in my most simple collections is :

{ "_id" : "example.com_1", "affiliateLink" : "http://www.example.com/?afftrack=[tracking]&urllink=[destination]" }

Note the custom ID but this is my only collection with a custom ID.

Sorry I'm not familiar with retrieving the metadata for a collection, I presume I just run a command from the mongo shell?

yocontra commented 12 years ago

It's possible the non-standard ID is causing issues with smog - looking into it

SeanBannister commented 12 years ago

Removed that collection and it still isn't working for that database, but I created a new database and added a collection and it works fine.

jeffthink commented 11 years ago

I also am having issues opening up a particular document when using a guid style id for my mongo ids: e.g. "c7039814-1bc0-4f19-8c0d-6c179325dc00"...no problems adding/removing/etc. databases or documents with normal mongo ids

yocontra commented 11 years ago

I'll look in my code I might be sorting by ID at some point

yocontra commented 11 years ago

@SeanBannister - Did the collection you were having issues with have capitals in the name?

SeanBannister commented 11 years ago

Yes they are camel case

yocontra commented 11 years ago

That's the issue right there - I was doing a toLowerCase on the collection name before sending it up to the server. Will fix now

SeanBannister commented 11 years ago

Good find, let me know when you push to npm and I'll test it out.

yocontra commented 11 years ago

Pushed and published

yocontra commented 11 years ago

@jeffthink - If you are still getting the issue after the latest update open a new issue

SeanBannister commented 11 years ago

Works great thanks :)