title: How can I search content by escaping the html tags from html statement in MongoDB document?
body: <p>(nodejs, mongodb)</p>
  <p>I am using WysiWyg Froala Editor to create content. (<a href="https://froala.com/" rel="nofollow noreferrer">https://froala.com/</a>)
  So, it is saved as an html statement in the db.</p>
  <p>In this case, when I searched, there was a problem that html tags and styles were also searched.
  <strong>(ex. When searching for &quot;stroke&quot;, it is searched even if it is not in the content because of &quot;stroke&quot; in &quot;webkit-text-stroke-width&quot;)</strong></p>
  <ol>
  <li><p>When using the WYSIWYG editor, is it the normal way to save it as an html statement in the db?</p>
  </li>
  <li><p>I would really appreciate it if you could give me an approximate direction (idea) on how to search only the actual content excluding the html tag when searching in mongodb.</p>
  </li>
  </ol>
  <p>2-1) Is it correct to use a regular expression to search only the actual content, excluding tags?(I'm trying to do this and that with regular expressions, but I can't solve it...)</p>
  <p>2-2) Should I use any other method? (I wonder if there are usually problems like mine when using the WYSIWYG editor..)</p>
  <p>This may be a basic question, but...
  please help</p>
  <p>(example)</p>
  <pre><code>{
      &quot;_id&quot; : ObjectId(&quot;6180ca2fbd2d6051904e609a&quot;),
  
      &quot;content&quot; : &quot;&lt;p&gt;blablabla~~~&lt;/p&gt;&lt;p&gt;blablabla~~~&lt;p&gt;&lt;span style=\&quot;font-size: 10px; color: rgb(209, 213, 216) -webkit-text-stroke-width: 0px;;\&quot;&gt;blablabla~~&lt;/span&gt;&lt;/p&gt;&quot;,
  
  }
  
  
  
  let exp = new RegExp(keyword, 'i');
  query.content = { $regex: exp };
  contents= db.Content.include(fields).find(query);
  
  </code></pre>