[MODM-148] Do not add '$db' in reference when referencing document from same $db Created: 02/Jun/11  Updated: 02/Jun/11

Status: Open
Project: Doctrine MongoDB ODM
Component/s: Document Manager
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Vladimir Razuvaev Assignee: Jonathan H. Wage
Resolution: Unresolved Votes: 0
Labels: None


When using ReferenceOne or ReferenceMany , doctrine will create fully-qualified reference to the object (with all fields: '$id', '$ref', '$db') even when reference is within same $db.

This approach causes several problems: for example we use mongo database as a template for new clients - when new client registers, template database is copied for him. But since it contains hardcoded $db - copy operation becomes resource consuming, since we have to loop through every document of every collection and fix $db reference.

Also maintenance suffers, since you can't easily rename database when required.

Is it possible to omit $db part when referencing document from same db?

Generated at Thu Mar 26 23:57:47 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.