You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The areaId has not been specified in 'select option argument'. With mongoose@4.12.0 areaId is also part of output json. Can you please let me know the reason for different output. and how can i fix this. Thanks.
The text was updated successfully, but these errors were encountered:
santoshmondal
changed the title
Autopopulate - Select options argument, issue with latest version of mongoose > 4.11.0
Autopopulate - Select options argument(return all fields), issue with latest version of mongoose > 4.11.0
Jul 27, 2018
Upon closer inspection this looks like expected behavior because you have an autopopulate on personSchema.areaId. In 4.11.14 we made a bug fix that automatically selects paths that you call populate() on, so in this case your schema is configured to populate() on areaId whenever you load a Person. Notice that, for example, nickName doesn't show up in the output.
As a workaround, you can use the maxDepth option to make sure the bandSchema autopopulates don't trigger any person autopopulate:
In band schema, I have specified following for people schema, autopopulate
Output with mongoose@4.4.5
Output with mongoose@4.12.0
The text was updated successfully, but these errors were encountered: