These are chat archives for Automattic/mongoose

17th
Oct 2017
Jemli Fathi
@jemliF
Oct 17 2017 15:07
hi
Is it possible to do a full text search, filter (using $match), aggregate and populate the results using the same query in Mongoose?
Jemli Fathi
@jemliF
Oct 17 2017 15:40
I tried the following:
Course.aggregate( [ { $unwind: '$trainer' }, { $match: {} }, { $group: { _id: { course: '$title', courseCategory: '$courseCategory' } } } ])
but got this error: MongoError: exception: Value at end of $unwind field path '$trainer' must be an Array, but is a OID