From 1757ca7313849a4ae7e364fc88b0ae1c8e34e383 Mon Sep 17 00:00:00 2001 From: Lench Volodymyr Date: Tue, 1 Mar 2022 10:41:17 +0200 Subject: [PATCH] filter out system fields --- reverse_engineering/api.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/reverse_engineering/api.js b/reverse_engineering/api.js index 47118ea..e671498 100644 --- a/reverse_engineering/api.js +++ b/reverse_engineering/api.js @@ -295,9 +295,17 @@ async function getDocumentsAmount(container) { } function filterDocuments(documents) { + const systemProperties = [ + "_rid", + "_self", + "_etag", + "_attachments", + "_ts", + ]; + return documents.map(item =>{ for(let prop in item){ - if(prop && prop[0] === '_'){ + if (systemProperties.includes(prop)){ delete item[prop]; } }