@Harpreeit If your User schema references all the different types of document he can own, then you can populate them in one query. (The disadvantage is that this might create double links, if the other documents already reference the user.) But if there is no link from the User schema, only links back from the other collections to the user _id, then you will have to make a separate lookup query on each collection. :/
hopes he understood at least one of those questions correctly
Hi there! I could not find anything related in github issues so I thought to ask here. Has lean() function changed recently how it works with default values? I'm getting some undefined errors from older objects because schema has changed but with lean() it does not return default values for those anymore. Without lean() it will return the default value if the object does not have it..
Ok, new question: I have store a moment() as a string in my model. But when I try to use find() to return records between two dates, it wouldn’t work with my own stored date. But it works with the “createdAt” timestamp… How can I save the moment so I can use it with my find function? Thanks!