diff --git a/forward_engineering/api.js b/forward_engineering/api.js index a465dbb..c562e88 100644 --- a/forward_engineering/api.js +++ b/forward_engineering/api.js @@ -61,7 +61,9 @@ const updateSample = (sample, containerData, entityData) => { }; const getPartitionKey = (_) => (containerData) => { - return _.get(containerData, '[0].partitionKey[0].name'); + const partitionKey = _.get(containerData, '[0].partitionKey[0].name', '').trim().replace(/\/$/, ''); + + return partitionKey; }; const add = (key, items, mapper) => (script) => { diff --git a/reverse_engineering/api.js b/reverse_engineering/api.js index e1d7d57..7af78d3 100644 --- a/reverse_engineering/api.js +++ b/reverse_engineering/api.js @@ -206,7 +206,7 @@ module.exports = { indexes: [], views: [], validation: createSchemaByPartitionKeyPath(partitionKey, filteredDocuments), - docType: bucketName, + docType: 'type', bucketInfo };