These are chat archives for Automattic/mongoose

15th
Nov 2016
Hrach Mnatsakanyan
@hrach_m_twitter
Nov 15 2016 07:11
Hello
I have added runValidators: true for findOneAndUpdate and it works for all validation
for my custom validation also
but not for required: true validation
Please any help
Hrach Mnatsakanyan
@hrach_m_twitter
Nov 15 2016 07:32
it is OK for PATCH request but should be required for PUT request
Justin F.
@fetherolfjd
Nov 15 2016 15:19
Hi, I'm trying to use Model.count({ <query here> }).exec() as part of a promise chain, but it seems to be breaking it; any thoughts?
Justin F.
@fetherolfjd
Nov 15 2016 17:16
As an update, it seems like there's some strange interaction going on with Q, underscore, and Mongoose. This code does not work as expected: return Q.all(_.mapObject(object, function(val, key) { return ChronicleEntry.count({ reference_id: key }).exec(); })); The Model.count() method does not continue the promise chain, but instead acts like regular async code when called.