These are chat archives for Automattic/mongoose

15th
Sep 2017
matthew harwood
@matthewharwood
Sep 15 2017 00:44
Hello!
Paul "Joey" Clark
@joeytwiddle
Sep 15 2017 09:29

My init middleware checks for certain fields and does things if they are empty.

But unfortunately if I have used .select(‘foo’) then of course most of the fields are empty!

How can I detect if I have a full document or a document that came from a .select()?

Scott Gilroy
@sgilroy
Sep 15 2017 17:45
@joeytwiddle Use http://mongoosejs.com/docs/api.html#document_Document-isSelected to test the path (field) you are interested in.