Retrieve string data from binary field within mongo shell (using JavaScript)

1,328 views
Skip to first unread message

Anton Koval'

unread,
Jul 27, 2011, 4:52:35 AM7/27/11
to mongodb-user
Hello,

I have some document which has binary field. This field contains a
string, encoded in utf-8.
Is it possible to retrieve this data within mongo shell?

thanks.

Spencer Brody

unread,
Jul 27, 2011, 1:33:26 PM7/27/11
to mongod...@googlegroups.com
Unfortunately this is not possible right now.  In 1.9.1, just released yesterday, there are some functions for displaying binary data as a hex or base64 encoded string, but nothing for UTF-8.  Check out https://jira.mongodb.org/browse/SERVER-3168 for more info.

Cheers,
-Spencer


--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.


Anton Koval'

unread,
Jul 29, 2011, 5:45:41 AM7/29/11
to mongodb-user
Sad, but anyway - thanks for your answer.

On Jul 27, 8:33 pm, Spencer Brody <spen...@10gen.com> wrote:
> Unfortunately this is not possible right now.  In 1.9.1, just released
> yesterday, there are some functions for displaying binary data as a hex or
> base64 encoded string, but nothing for UTF-8.  Check outhttps://jira.mongodb.org/browse/SERVER-3168for more info.

Spencer Brody

unread,
Jul 29, 2011, 10:20:59 AM7/29/11
to mongod...@googlegroups.com
If you think this would be a good feature to add to the shell, you could file a feature request at https://jira.mongodb.org and we'll add it to our backlog.  Or you could code it up submit a pull request for the patch!

-Spencer
Reply all
Reply to author
Forward
0 new messages