On Thu, Jul 3, 2014 at 10:01 PM, Tim Penhey <tim.pen...@canonical.com> wrote:
> As far as I know (and I may be wrong), if you are adding a document to
> the mongo collection, and you do not specify an _id field, mongo will
> create a unique value for you.

That's right in most cases, and a requirement for replication.

> 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.


gustavo @ http://niemeyer.net

-- 
Juju-dev mailing list
Juju-dev@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju-dev

Reply via email to