<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Dec 13, 2012, at 10:48 AM, Sebastien Blanc &lt;<a href="mailto:scm.blanc@gmail.com">scm.blanc@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi,<div>I'm not really confortable with the double dot, but I have no other idea for the moment :) (maybe '-&gt;' ?).</div></blockquote><div><br></div>Hmm, the arrows have too much baggage (arrows in typescript and coffeescript, the fat arrow (=&gt;) making it into es6). Not sure I want to go down that path.<br><blockquote type="cite"><div>And should your pseudo code not be written this way :&nbsp;</div><span style="font-family:arial,sans-serif;font-size:13px"><div>
<span style="font-family:arial,sans-serif;font-size:13px"><br></span></div>var filtered = filter({</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">&nbsp; &nbsp; &nbsp; &nbsp; "x.sites.'<a href="http://google.com/">google.com</a>'.type": {</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; data: &nbsp;"search engine"</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">&nbsp; &nbsp; &nbsp; &nbsp; }</span><br style="font-family:arial,sans-serif;font-size:13px">
<div><span style="font-family:arial,sans-serif;font-size:13px">});</span>&nbsp;</div><div><br></div><div>?</div></blockquote><div><br></div>I don't think so. That would still not work and the point was to show that the dots would really mess stuff up.</div><div><br><blockquote type="cite"><div>Seb</div><div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Dec 13, 2012 at 5:22 PM, Kris Borchers <span dir="ltr">&lt;<a href="mailto:kris@redhat.com" target="_blank">kris@redhat.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey all, I am trying to enhance the filter method to be able to filter objects based on values nested inside other objects inside that main object. My first thought was just to use dot notation to specify the field we are filtering on but that runs into issues if the key actually has a "." in it like this:<br>

<br>
var x = {<br>
&nbsp; &nbsp; &nbsp; &nbsp; sites: {<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "<a href="http://google.com/" target="_blank">google.com</a>": {<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; type: "search engine"<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&nbsp; &nbsp; &nbsp; &nbsp; }<br>
}<br>
<br>
Trying to traverse that object via:<br>
<br>
// pseudocode<br>
var filtered = filter({<br>
&nbsp; &nbsp; &nbsp; &nbsp; "x.sites.google.com.type": {<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; data: &nbsp;"search engine"<br>
&nbsp; &nbsp; &nbsp; &nbsp; }<br>
});<br>
<br>
would fail. I'm wondering if we should just define our own separator for the path through the object. We could use ".." (double-dot) which I think should work so something like:<br>
<br>
// pseudocode<br>
var filtered = filter({<br>
&nbsp; &nbsp; &nbsp; &nbsp; "x..sites..<a href="http://google.com">google.com</a>..type": {<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; data: &nbsp;"search engine"<br>
&nbsp; &nbsp; &nbsp; &nbsp; }<br>
});<br>
<br>
Then I can separate on ".." and parse that way. Thoughts?<br>
_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a><br>
</blockquote></div><br></div>
_______________________________________________<br>aerogear-dev mailing list<br><a href="mailto:aerogear-dev@lists.jboss.org">aerogear-dev@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/aerogear-dev<br></blockquote></div><br></body></html>