Mongoose queries the data as an array, but returns [] when it uses _.intersection () to take the intersection of the two arrays found from.

  mongodb, question

The mongoose query returns an array of data, but when using the _.intersection () of underscore to take the intersection of two arrays found in the database, it returns []. Why?

It’s the data problem you found out, it’s an array object, not just an array.