Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这是此问题中查询的更复杂版本
我有这些猫鼬模式:
var Thread = new Schema({ title: String, messages: [Message] }); var Message = new Schema({ date_added: Date, author: String, text: String });
您如何返回所有带有最新Message子文档(限制 1)的线程Message以及没有任何子文档的所有线程?
Message