title: Mongoose combine two queries for same collection
body: <p>I am trying to make a query to find documents depending on another document in the same collection as below.</p>
  
  <p>The first one finds the user and the second one finds the data by using that user data received. But I want to do it with one query like join in SQL</p>
  
  <p>This is schema</p>
  
  <pre><code>var ConnectionSchema = new Schema({
  socketId: {
      type: String,
      require: true
  },
  location: {
      type: [Number],
      index: '2dsphere'
  },
  user: { type: Schema.ObjectId, ref: "User" },
  date: {
      type: Date,
      require: true,
      default: new Date()
  }
  </code></pre>
  
  <p>});</p>
  
  <p>// queries</p>
  
  <pre><code>return mongoose.model("Connection").findOne({ user: userId }).populate("user").then(usr =&gt; {
      return mongoose.model("Connection").find({
          location: {
              $near: {
                  $maxDistance: config.searchDistance,
                  $geometry: { type: Number, coordinates: usr.location }
              }
          },
          user: { $ne: userId },
      });
  });
  </code></pre>
  
  <p>Is there any way to do that with a just single query? 
  Thanks.</p>