Documents & Collections
Create dedicated document and collection pairs when data must remain separate.
Real isolation requires real classes
To separate stored data, provide dedicated alias document and collection classes. Mapping an origin collection to a nonexistent alias class is insufficient. Leaving the origin collection active can cause both applications to use the same data.
Two-way relationship
The source examples use `#[Database(document: ...)]` on a collection and `#[Database(collection: ...)]` on its document. Verify that both annotations refer to the intended alias classes and that the resulting collection name is distinct.
Coverage
Map both Core data classes and application-specific origin data classes used by the alias. Pay attention to users, groups, sessions, content documents and business-specific collections.
Configuration and command examples
These examples are preserved from the alias pre-documentation. Review the active environment and application names before applying them.
namespace AppnetosAliasDnsControl\Core\Collection;
use AppnetosAliasDnsControl\Core\Document\AppnetosAliasDnsControlAdminUser;
use AppnetosDnsControl\Core\Collection\AppnetosDnsControlAdminUserCollection;
use Core\Collection\Annotation\Database;
#[Database(document: AppnetosAliasDnsControlAdminUser::class)]
class AppnetosAliasDnsControlAdminUserCollection extends AppnetosDnsControlAdminUserCollection
{
}
namespace AppnetosAliasDnsControl\Core\Document;
use AppnetosAliasDnsControl\Core\Collection\AppnetosAliasDnsControlAdminUserCollection;
use AppnetosDnsControl\Core\Document\AppnetosDnsControlAdminUser;
use Core\Document\Annotation\Database;
#[Database(collection: AppnetosAliasDnsControlAdminUserCollection::class)]
class AppnetosAliasDnsControlAdminUser extends AppnetosDnsControlAdminUser
{
}