Using subdocument _id fields for multi-environment support
Menno Smits
menno.smits at canonical.com
Wed Oct 1 20:11:31 UTC 2014
On 2 October 2014 01:31, Kapil Thangavelu <kapil.thangavelu at canonical.com>
wrote:
> it feels a little strange to use a mutable object for an immutable field.
> that said it does seem functional. although the immutability speaks to the
> first disadvantage noted for the separate fields namely becoming out of
> sync, which afaics isn't something that's possible with the current model,
> ie. a change of name needs to generate a new doc. Names (previous _id) are
> unique in usage minus the extant bug that unit ids are reused. even without
> that the benefits to avoiding the duplicate doc data and manual parse on
> every _id seem like clear wins for subdoc _ids.
>
Just to be really sure, I added a test that exercises the case of one of
the _id fields changing. See TestAttemptedIdUpdate in the (just updated)
gist. MongoDB stops us from doing anything stupid (as expected).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-dev/attachments/20141002/8640129f/attachment.html>
More information about the Juju-dev
mailing list