title: How do I clean the specific items in nested array
body: <p>I want to remove the items only contain white spaces.</p>
  
  <p>eg: <code>"               "</code>, <code>"     "</code></p>
  
  <p>I want to remove them from <code>buy_items</code> array.</p>
  
  <p>How to do it ? thanks</p>
  
  <h1>sample document</h1>
  
  <pre><code>{
    "_id": "mark jordan",
    "records": [
      {
        "date": new Date("2012-05-04T08:00:00+0800"),
        "buy_items": [
          "6829           ",
          "               ",
          "68600          ",
          "8830           "
        ]
      },
      {
        "date": new Date("2011-02-10T08:00:00+0800"),
        "buy_items": [
          "4659 ",
          "     ",
          "4660 "
        ]
      },
      {
        "date": new Date("2011-01-09T08:00:00+0800"),
        "buy_items": [
          "     ",
          "4659 "
        ]
      }
    ]
  }
  </code></pre>