Cleansing Mongo data
Menno Smits
menno.smits at canonical.com
Thu Jun 23 21:38:18 UTC 2016
Thanks, this is really useful - especially when writing data into the
database that comes sources that the code doing the writing doesn't have
control over.
Two little things:
1. The docstring for EscapeKeys still mentions statusDoc.
2. Are you sure this needs to be in it's own package, especially one called
"utils"? Given we already have the widely used github.com/juju/utils - as
well as others with that name under juju/juju - this one is predestined to
be aliased everywhere it's imported. Couldn't these escaping functions just
live in their own file in github.com/juju/juju/mongo? Even when the import
isn't aliased, the intent of "mongo.EscapeKeys(...)" is clearer than
"utils.EscapeKeys(...)".
- Menno
On 24 June 2016 at 08: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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-dev/attachments/20160624/4692e86d/attachment.html>
More information about the Juju-dev
mailing list