title: Finding nested array data with elemMatch in MongoDB/Meteor
body: <p>collection structure as such:</p>
  
  <pre><code>{"_id" : "abc",
  "potentialUsers" : [{"userID" : "def"}, 
                      {"userID" : "ghi"}]
  },
  
  {"_id" : "123",
  "potentialUsers" : [{"userID" : "456"}, 
                      {"userID" : "789"}]
  },
  </code></pre>
  
  <p>I want to query if user abc has the user def in their potential users array. My current query (client) is </p>
  
  <pre><code>    getPendingLiftRequests: function() {
          return collection.find({}, {potentialUsers: {$elemMatch: {userID: Meteor.user().services.facebook.id}}});
      }
  </code></pre>
  
  <p>On the server I publish all of that collection to the user, and then just selectively show it based on the view of the client. However, when I try to use an elemMatch on the array, it just shows all of the records, when it should only show 1. </p>