title: Javascript Objects + Elasticsearch hits array of objects
body: <p>I have a class A in javascript and I am inserting an instance of A as an object in elasticsearch. When I query for the inserted object I get the results as the array of objects. but the returned object is not an instance of class A (even though the fields and the values are a match) how to make it an instance of class A so I can have access to class A's methods.</p>