I have a document with objectId reference field that can be populated.
Is there a known way to know if the field was already populated?
You could use the document.populated(path)
method (as documented here). It returns the _id used for population, and undefined
if the field has not been populated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With