These are chat archives for Automattic/mongoose

15th
Jul 2017
Julian Claus
@ndabAP
Jul 15 2017 10:32
Hey, is it possible to remove fields like createdAt or _id at every find event without calling toObject/toJSON?
Adel
@AdelMahjoub
Jul 15 2017 22:33
@ndabAP do you mean projection ? Model.find({condition}, {projection}, callback)
@ndabAP Model.find({condition}, {_id: 0, __v: 0}, callback) will not return the _id field and the __v field