AngularFire2 query by child object
<p>Angular application using AngularFire2.  I'm attempting to query firebase on a child object, rather than just a child string property.  Querying by the child string property works, but how can I query by the entire object.</p>

<p>This code works</p>

<pre><code>    // Given the following firebase data structure
    httpCache: {
        {ID}: {
            url: 'www.fakeurl',
            otherProperties: {}
        }
    }

    // This code will return results if exists where the url matches
    this.af.database.list('httpCache', {
        query: {
           orderByChild: 'url',
           equalTo: 'www.fakeurl'
        }
    }).subscribe(x =&gt; {
        if (x.length &gt; 0) { console.log('match found!'); }
    });
</code></pre>

<p>This code does not work:</p>

<pre><code>    // Given the following firebase data structure
    httpCache: {
        {ID}: {
            request: {
                url: 'www.fakeurl',
                params: 'id=1'
            },
            otherProperties: {}
        }
    }

    // This code throws an exception
    let request = {
        url: 'www.fakeurl',
        params: 'id=1'
    };
    this.af.database.list('httpCache', {
        query: {
            orderByChild: 'request',
            equalTo: request
        }
    }).subscribe(x =&gt; {
        if (x.length &gt; 0) { console.log('match found!'); }
    });
</code></pre>

<p>Here is the exception:</p>

<pre><code>Query: First argument passed to startAt(), endAt(), or equalTo() cannot be an object.
</code></pre>

<p>I'm attempting to use the 2nd solution shown here where the filter criteria is pushed into a child object containing all filter properties:
<a href="https://stackoverflow.com/questions/26700924/query-based-on-multiple-where-clauses-in-firebase">Query based on multiple where clauses in firebase</a></p>