Search filter with KnockoutJS
<p>I'm trying to implement the search filter in my web app. I read some good articles and i found some good Jsfiddles. </p>

<p>I want to search by <code>TypeName</code> and show the row with that typename.
I implemented it in my model but i get and error when i search:
<code>main.js:48 Uncaught TypeError: item.TypeName is not a function</code> also the screen <a href="http://i.stack.imgur.com/3HYfj.png" rel="nofollow">error</a></p>

<p>My index.html: </p>

<pre><code>&lt;div class="form"&gt;
    &lt;div class="form-group"&gt;
           &lt;input type="search" class="form-control" data-bind="textInput: query" autocomplete="off" /&gt;
      &lt;/div&gt;
    &lt;/div&gt;

    &lt;div id="tab1" class="col s12"&gt;
        &lt;ul class="collapsible" data-collapsible="accordion" data-bind="foreach:brickInfos"&gt;
            &lt;li  data-bind="with: value"&gt;
              &lt;div class="collapsible-header"&gt;
                &lt;i class="material-icons"&gt;view_stream&lt;/i&gt;
                &lt;p class="blue-text" data-bind="text: TypeName"&gt;&lt;/p&gt;
              &lt;/div&gt;
            &lt;/li&gt;
        &lt;/ul&gt;
    &lt;/div&gt;
</code></pre>

<p>My model : </p>

<pre><code>function ViewModel() {
  var self = this;
  self.brickInfos =  ko.observableArray([]);

  db.query("BrickInfos/docs").then(function(result) {
    var data = result;
    console.log(data);
    self.brickInfos(data.rows);
  });

  self.query = ko.observable("");
  self.filteredBrickInfos = ko.computed(function () {
      var filter = self.query().toLowerCase();

      if (!filter) {
          return self.brickInfos();
      } else {
          return ko.utils.arrayFilter(self.brickInfos(), function (item) {
              return item.data.TypeName().toLowerCase().indexOf(filter) !== -1;
          });
      }
  });
}

  var db = new PouchDB('http://localhost:5984/helloworld');
  var vm = new ViewModel();



  ko.applyBindings(vm);
</code></pre>

<p>This is how my data looks: <a href="http://i.stack.imgur.com/3o5Hi.png" rel="nofollow">Json data on console</a></p>

<p>Any good advice how i should structure my code is always welcome, cuz i'm new in KnockoutJS.
Thank you</p>

<p>I posted the JSON here:</p>

<pre><code>{
    "BrickInfos":  {
                       "BrickInfos":  [
                                          {
                                              "Properties":  {
                                                                 "Properties":  [

                                                                                ]
                                                             },
                                              "Implements":  {
                                                                 "Interfaces":  [
                                                                                    {
                                                                                        "TypeName":  "soemtypename"
                                                                                    },
                                                                                    {
                                                                                        "TypeName":  "soemtypename2"
                                                                                    }
                                                                                ]
                                                             },
                                              "Name":  "AccessBareBoneApp",
                                              "Description":  "",
                                              "TypeName":  "soemtypename",
                                              "AssemblyName":  "string other safasgfas",
                                              "Obsolete":  true
                                          },
                                          {
                                              "Properties":  {
                                                                 "Properties":  [
                                                                                    {
                                                                                        "Name":  "file",
                                                                                        "Description":  "asfasf",
                                                                                        "ValidationType":  12,
                                                                                        "Converter":  12,
                                                                                        "EnumTypeName":  "string1"
                                                                                    }
                                                                                ]
                                                             },
                                              "Implements":  {
                                                                 "Interfaces":  [
                                                                                    {
                                                                                        "TypeName":  "soemtypename"
                                                                                    },
                                                                                    {
                                                                                        "TypeName":  "soemtypename"
                                                                                    }
                                                                                ]
                                                             },
                                              "Name":  "File2",
                                              "Description":  "asfasfas",
                                              "TypeName":  "soemtypename",
                                              "AssemblyName":  "string other safasgfas",
                                              "Obsolete":  false
                                          }
                                          ]
                                        }
                                      }
</code></pre>