Cleansing Mongo data
Katherine Cox-Buday
katherine.cox-buday at canonical.com
Fri Jun 24 16:03:59 UTC 2016
As I have only just discovered the need to cleanse mongo data, I can't say for sure, but it looks like we may have been cleansing things in the parts of Juju that need it. William may know more.
If not, I imagine a small upgrade step would make short work of any problems.
roger peppe <roger.peppe at canonical.com> writes:
> This is useful, thanks.
>
> Note that's it's not necessary to cleanse *all* keys that go into Mongo,
> just the ones that might be used in queries.
>
> But one thought... what about keys that already contain full-width
> dollar and dot?
>
> cheers,
> rog.
>
> On 23 June 2016 at 21:09, Katherine Cox-Buday
> <katherine.cox-buday at canonical.com> wrote:
>> Hey all,
>>
>> William gave me a good review and it came up that I wasn't cleansing
>> some of
>> the data being placed in Mongo. I wasn't aware this had to be done,
>> and
>> after talking to a few other folks it became apparent that maybe not
>> many
>> people know we should be doing this.
>>
>> At any rate, William also pointed me to some existing code which did
>> this.
>> I've pulled it out into the mongo/utils package for general
>> consumption. The
>> comments do a pretty good job of elucidating why this is necessary.
>>
>> https://github.com/juju/juju/blob/master/mongo/utils/data_cleansing.go
>>
>> -
>> Katherine
>>
>> --
>> Juju-dev mailing list
>> Juju-dev at lists.ubuntu.com
>> Modify settings or unsubscribe at:
>> https://lists.ubuntu.com/mailman/listinfo/juju-dev
>>
--
Katherine
More information about the Juju-dev
mailing list