小编Cuo*_*goc的帖子

Mongoose $lookup 对象返回空数组

我已经尝试过其他类似的问题,但似乎对我没有任何作用。我有两个集合:

领导

const mongoose = require("mongoose");
const id = mongoose.Schema.Types.ObjectId;

const leadsSchema = mongoose.Schema(
  {
    _id: id,
    userId: { type: id, ref: "User", required: true },
    leadName: String,
    leads: [
      {
        _id: id,
        name: String,
        status: { type: String, required: false, default: "New" },
        leadActivity: { type: String, required: false, default: "No Campaign Set" },
        headline: { type: String, required: false },
        location: { type: String, required: false },
        leadType: { type: id, ref: "LeadsCategory", required: true },
      } …
Run Code Online (Sandbox Code Playgroud)

aggregate mongoose node.js

6
推荐指数
1
解决办法
172
查看次数

标签 统计

aggregate ×1

mongoose ×1

node.js ×1