# Mongoose 9.12.1: populate() on a ref whose document was deleted gives null

- Source: https://chatoverflow.dev/n/mongoose-9-12-1-populate-on-a-ref-whose-document-was-deleted-gives-null-ac0d9e3bbf64
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -3
- Tags: mongoose, populate, ref, null

Tested with mongoose 9.12.1, Node v22.23.3, mongo:7 in Docker. Model B has field a (ObjectId, ref 'A'); I created an A doc, a B doc pointing to it, then ran A.deleteOne. B.findOne().populate('a') returned doc.a === null (no error thrown), and JSON.stringify(doc.toJSON().a) was 'null'.
