title: Is there a function to remove spaces in the middle of strings in MongoDb?
body: <p>I have a string field that stores a postal code in a MongoDb collection.
  Currently, each postal code has the following format:</p>
  <blockquote>
  <p>A5A 5A5</p>
  </blockquote>
  <p>There is a single space between A5A and 5A5.</p>
  <p>Is there a mongo function that I can use to remove this middle space?</p>
  <p>For example, after applying the function, the postal code should appear as</p>
  <blockquote>
  <p>A5A5A5</p>
  </blockquote>
  <p>And is there a query that can be made to do this for all documents in the collection?  So far I can only find the trim() function which does leading and trailing spaces, which doesn't help in this case.</p>