Small improvement to Cockpit-Node

This commit is contained in:
Jan Oberhauser
2020-04-12 12:28:36 +02:00
parent 532b9a9294
commit ef26a4bfe5
4 changed files with 32 additions and 20 deletions

View File

@@ -27,7 +27,16 @@ export async function getAllCollectionEntries(this: IExecuteFunctions | IExecute
const body: ICollection = {};
if (options.fields) {
body.fields = JSON.parse(options.fields.toString());
const fields = (options.fields as string).split(',').map(field => field.trim() );
const bodyFields = {
_id: false,
} as IDataObject;
for (const field of fields) {
bodyFields[field] = true;
}
body.fields = bodyFields;
}
if (options.filter) {