These are chat archives for Automattic/mongoose

11th
Sep 2018
Arun Kumar
@arunkumar413
Sep 11 2018 02:12
@lineus Thanks a lot, Kev.
Andrey Gazhala
@AndreyGazhala
Sep 11 2018 12:30
Hello to all) When I use this code, I have an error Error: Can't use $elemMatch with String. Does anyone know what the problem is?
Category.findOne({ 'name' : { $elemMatch : { $regex : 'прочее', $options : 'i' }}})
            .populate('article')
            .exec(function(err, templateCategory) {
Kev
@lineus
Sep 11 2018 13:30
@AndreyGazhala is your name path an array or a string type?
Andrey Gazhala
@AndreyGazhala
Sep 11 2018 14:10
@lineus string
@lineus this code worked, I do not understand the error