Skip to content

Commit

Permalink
filter out system fields
Browse files Browse the repository at this point in the history
  • Loading branch information
lenchvolodymyr committed Mar 1, 2022
1 parent 28b2243 commit 1757ca7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion reverse_engineering/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
}
Expand Down

0 comments on commit 1757ca7

Please sign in to comment.