From 682c81d41d7717ecf0c42f9d2d75fa07fa329a67 Mon Sep 17 00:00:00 2001 From: missinglink Date: Fri, 7 Jul 2017 13:25:40 +0200 Subject: [PATCH] feat(refactor): don't strip mandatory properties --- Document.js | 3 --- test/document/toESDocument.js | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Document.js b/Document.js index 1ae4c8e..0a97008 100644 --- a/Document.js +++ b/Document.js @@ -67,11 +67,8 @@ Document.prototype.toESDocument = function() { }; // remove empty properties - if( _.isEmpty( doc.name ) ){ delete doc.name; } - if( _.isEmpty( doc.phrase ) ){ delete doc.phrase; } if( _.isEmpty( doc.parent ) ){ delete doc.parent; } if( _.isEmpty( doc.address_parts ) ){ delete doc.address_parts; } - if( _.isEmpty( this.center_point ) ){ delete doc.center_point; } if( _.isEmpty( this.category ) ){ delete doc.category; } return { diff --git a/test/document/toESDocument.js b/test/document/toESDocument.js index c05c4a6..6971f39 100644 --- a/test/document/toESDocument.js +++ b/test/document/toESDocument.js @@ -27,7 +27,10 @@ module.exports.tests.toESDocument = function(test) { _type: 'mylayer', _id: 'myid', data: { + center_point: {}, layer: 'mylayer', + name: {}, + phrase: {}, source: 'mysource', source_id: 'myid' }