fixed the population of nested documents, based on model configuration

Signed-off-by: Alexander Knapstein <alexander.knapstein@inspirationlabs.com>