我收集了以下形状的文件:
const categorySchema = new Schema<ICategory>({ title: { type: String, required: true }, children: [{ type: Types.ObjectId, ref: categoryModelName }], });
我想获取集合中所有其他文档的子数组属性中未包含的所有文档 ID。如果可能,如何编写这样的查询?