diff --git a/bi-queries/controller/pipeline-builder.ts b/bi-queries/controller/pipeline-builder.ts index 75465d3..a86805d 100644 --- a/bi-queries/controller/pipeline-builder.ts +++ b/bi-queries/controller/pipeline-builder.ts @@ -9,7 +9,7 @@ export function createPipeline(queryData: IQuery, params: IParams[]) { if (v) { if (arg.tipo === 'date') { v.valor = moment(v.valor).toDate(); - } else if (Types.ObjectId.isValid(v.valor) && new Types.ObjectId(v.valor).toString() === v.valor) { + } else if (Types.ObjectId.isValid(v.valor) && new Types.ObjectId(v.valor).toString() === v.valor && (arg.formato !== 'string')) { v.valor = new Types.ObjectId(v.valor); } } diff --git a/bi-queries/package.json b/bi-queries/package.json index 27092b4..c232142 100644 --- a/bi-queries/package.json +++ b/bi-queries/package.json @@ -10,7 +10,7 @@ "tsc:w": "../node_modules/typescript/bin/tsc -w", "node": "nodemon -q ./index.js" }, - "author": "Celeste Ramos y Luis Parada", + "author": "ANDES", "license": "ISC", "dependencies": { "@andes/bootstrap": "file:../bootstrap", diff --git a/bi-queries/schemas/query.ts b/bi-queries/schemas/query.ts index cee47d3..372d6de 100644 --- a/bi-queries/schemas/query.ts +++ b/bi-queries/schemas/query.ts @@ -10,6 +10,7 @@ export type IQuery = { key: string; label: string; tipo: string; + formato?: string, required: boolean; subquery: any; }[]; @@ -43,6 +44,7 @@ export const QuerySchema = new mongoose.Schema({ key: String, label: String, tipo: String, + formato: String, required: Boolean, subquery: mongoose.SchemaTypes.Mixed,