문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top