public function addConstraints()
{
// For belongs to relationships, which are essentially the inverse of has one
// or has many relationships, we need to actually query on the primary key
// of the related models matching on the foreign key that's on a parent.
$key = $this->related->getKeyName();
$this->query->where($key, new MongoID((string) $this->parent->{$this->foreignKey}));
}