title: Mongoose Virtual Populate, what is mongoose#trustedSymbol?
body: <p>This are my schemas:</p>
  <p>user.js</p>
  <pre><code>'use strict'
  
  const { models, model, Schema } = require('mongoose')
  
  const schema = new Schema(
      {
          name: {
              type: String,
              required: true,
          },
      },
      {
          timestamps: true,
          discriminatorKey: 'type',
      }
  )
  
  schema.virtual('posts', {
      ref: 'Post',
      localField: '_id',
      foreignField: 'user',
  })
  
  module.exports = models.User|| model('User', schema)
  </code></pre>
  <p>post.js</p>
  <pre><code>'use strict'
  
  const { models, model, Schema } = require('mongoose')
  
  
  const schema = new Schema(
      {
          text: {
              type: String,
              required: true,
          },
          user: {
              type: Schema.Types.ObjectId,
              ref: 'User',
              required: true,
          },
      },
      {
          timestamps: true,
          discriminatorKey: 'type',
      }
  )
  
  module.exports = models.Post|| model('Post', schema)
  </code></pre>
  <p>And the Query:</p>
  <pre><code>const user = await UserModel.findById(req.params.id).populate('posts')
  </code></pre>
  <p>I don't know what i doing wrong, but populate is not returning anything</p>
  <p>I turn on my mongoose debug flag to check what is the query for virtual populate and see that on my terminal:</p>
  <pre><code>Mongoose: users.findOne({ _id: new ObjectId(&quot;6182fce8c339b6f51c933eee&quot;) }, { projection: {} })
  Mongoose: posts.find({ user: { '$in': [ new ObjectId(&quot;6182fce8c339b6f51c933eee&quot;) ], [Symbol(mongoose#trustedSymbol)]: true }}, { skip: 0, limit: 10, perDocumentLimit: undefined, projection: {} })
  </code></pre>
  <p>I do the query manually again</p>
  <pre><code>const posts = await PostModel.find({credential: { $in: [Types.ObjectId(req.params.id)]}})
  </code></pre>
  <p>and return data :/</p>
  <p>and terminal print:</p>
  <pre><code>Mongoose: posts.find({ user: { '$in': [ new ObjectId(&quot;6182fce8c339b6f51c933eee&quot;) ] } }, { projection: {} })
  </code></pre>