fluent / fluent-plugin-mongo

MongoDB input and output plugin for Fluentd
https://docs.fluentd.org/output/mongo
173 stars 61 forks source link

BSON or JSON #13

Closed sylvainkalache closed 12 years ago

sylvainkalache commented 12 years ago

Hey guys,

I found an issue with fluent-plugin-mongo, when I send a BSON format hash, this one would not get to MongoDB: {10 => "blah"}

However if I change the key to a string, then it works: {"10" => "blah"}

In case fluent-plugin-mongo should accept BSON then there is probably a bug, if fluent-plugin-mongo should not accept BSON then it should throw up an error.

Let me know if you need more info.

Cheers! Sylvain

repeatedly commented 12 years ago

{10 => "blah"} is not BSON format. BSON's key must be string. In this case, fluent-plugin-mongo treats such format as a broken data.

But, this feature is incomplete. See #12 I will fix this issue ASAP.

sylvainkalache commented 12 years ago

Masahiro,

Thanks for your answer and sorry about the confusion for BSON format, I'll follow the progress of the feature.

Cheers! Sylvain

repeatedly commented 12 years ago

@sylvainkalache

I fixed issue #12 and release the version of 0.6.7.

https://github.com/fluent/fluent-plugin-mongo/commit/61fd992a5fa5d1883235505bbb4fef5bc73743d9

In my test, broken string and invalid key documents are converted to BSON's binary. Please try new version!

the confusion for BSON format

MessagePack can (de)serialize this format ;)