Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

BSON BinData is not handled correctly #28

Closed
mweibel opened this issue Sep 19, 2012 · 18 comments
Closed

BSON BinData is not handled correctly #28

mweibel opened this issue Sep 19, 2012 · 18 comments
Labels
Milestone

Comments

@mweibel
Copy link

mweibel commented Sep 19, 2012

See:

http://cl.ly/image/1f1Z313D012V

Thanks for the app :)

@bobthecow
Copy link
Owner

Ooh. That's an interesting one. You're using BinData for an ID? What would you expect to have happen in this case?

@bobthecow
Copy link
Owner

Proper GridFS and BinData support is on my shortlist for v2.1 features, but in this case I'm not sure how best to represent it in the document heading (and incidentally, in the URL). What is your BinData ID composed of?

@mweibel
Copy link
Author

mweibel commented Sep 20, 2012

Well I guess it's a little bit hard to cover all cases what a BinData can consist of.
We use UUID BinData (Subtype 3) so I think the best way for us would be if you could render it to an UUID.

The question is: What happens when someone else uses something different for it. Maybe you could define different representations for different subtypes of BinData or just use the same format as e.g. the mongo CLI displays (and for the URL you could urlencode it or something like that..)

Thanks for this tool btw. it's nice to finally have a good looking and working tool :)

@pstadler
Copy link

+1

Oh, by the way: before saving (updating) a record containing a BinData object, it might be necessary to prepend the keyword new to it. Example:

{ "_id" : BinData(3,"PXvPG7WxT029i0N17Corog=="), ... }     // bar = db.foo.findOne();
{ "_id" : new BinData(3,"PXvPG7WxT029i0N17Corog=="), ...}  // db.foo.save(bar);

@bobthecow
Copy link
Owner

Something like this?

I'm thinking we use a special case for the document title when it's a UUID BinData, otherwise just the base64 encoded binary string.

@mweibel
Copy link
Author

mweibel commented Sep 20, 2012

I think that's perfect! Very nice :)

@bobthecow
Copy link
Owner

Awesome. It's 95% implemented, and will be in v2.1. Along with the ID fix, I fixed BinData rendering and editing in the whole document (as you can see from the screenshot).

@pstadler
Copy link

Great, thanks a lot! :-)

@bobthecow
Copy link
Owner

Committed and pushed to the develop branch. Do me a favor and run genghis.php or genghis.rb from the dev branch locally and make sure it does what you think it should?

Thanks!

@mweibel
Copy link
Author

mweibel commented Sep 21, 2012

http://cl.ly/image/1x1B41051h3m

Thanks a lot, seems to work besides saving which tells me that "t" is undefined.

Also when editing, the textarea is very small initially (you can resize it but it would be nice to have the full size).

When editing documents with BinData in it it might be helpful to add a "new" before the BinData statements because otherwise I think it won't work.

But really nice work :)

@bobthecow
Copy link
Owner

It will work with or without the new in Genghis. It's awesome that way :)

I'm not sure about the "t" and editor... That's definitely not what the editor should be showing. For some reason the rich editor isn't showing up.

@bobthecow
Copy link
Owner

Also, shouldn't that be BinData(3, ...) instead of BinData("3", ...)?

@bobthecow
Copy link
Owner

Hmm. The rich editor doesn't show up when editing a doc with BinData, but does for all other docs. Looks like a bug :)

@bobthecow
Copy link
Owner

Okay. Should be fixed now. Take a look?

@bobthecow
Copy link
Owner

Just pushed a fix for that quoted subtype argument.

@mweibel
Copy link
Author

mweibel commented Sep 23, 2012

Hi,

You're so fast!

I'll take a look on tuesday because then I'm back at the office.

Thanks again :)

@bobthecow
Copy link
Owner

This has been merged into develop and will be going out with v2.1.

@mweibel
Copy link
Author

mweibel commented Sep 28, 2012

Hey, sorry didn't had time on tuesday for it. It works perfectly :) Thanks a lot

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants