On Fri, Jul 4, 2014 at 6:56 AM, Gustavo Niemeyer <gust...@niemeyer.net> wrote:
> > 1. change the _id field to be a "composed" field where it is the > > concatenation of the environment id and the existing id or name field. > > If we do take this approach, I strongly recommend having the fields that > > make up the key be available by themselves elsewhere in the document > > structure. > > I'd go with this, including your suggestion of splitting the data > apart in proper fields. Sounds straightforward and comfortable to deal > with. > > I'd be interested in trying this approach with Actions. We've gone back and forth between encoding units *only* in the _id or *also* in the document. Both have pro's and con's, but it seems to me that a composite _id would address most of the con's on each approach. I'm also interested in figuring out how the watchers will work in this approach. The Actions watcher is a StringsWatcher, and the .Changes() are []string I'm assuming that will have to become a more specialised watcher where .Changes() returns a list of objects representing the composite key? Also how the watcher detects relevant events might have to be adjusted somewhat. -- John Weldon
-- Juju-dev mailing list Juju-dev@lists.ubuntu.com Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/juju-dev