title: How to find records in nested documents?
body: <p>So I'm learning <code>mongoose</code> and I've implemented a <code>Customer</code> model like this:</p>
  
  <pre><code>let CustomerSchema = new Schema({
      stripe_id: {
          type: String,
          required: true
      },
      telegram_id: {
          type: Number
      },
      email: {
          type: String,
          required: true
      },
      subscriptions: [SubscriptionSchema],
      created_at: {
          type: Date,
          default: Date.now,
          required: true
      }
  });
  </code></pre>
  
  <p>essentially I would like to return all the subscriptions of a customer, but how can I search in nested document, in this case <code>subscriptions</code>?</p>
  
  <p>This is the subscription model:</p>
  
  <pre><code>let SubscriptionSchema = new Schema({
      status: {
          type: String,
          required: true
      },
      plan_id: {
          type: String,
          required: true
      }
  });
  </code></pre>
  
  <p>I would like to return only the subscriptions which have as status <code>active</code>, at the moment I'm able to search for customer as:</p>
  
  <pre><code>let customer = await CustomerModel.findOne({telegram_id: ctx.chat.id});
  </code></pre>