代码之家  ›  专栏  ›  技术社区  ›  sreepurna

如何在文档中搜索任何值

  •  0
  • sreepurna  · 技术社区  · 6 年前

    const pschema = new Schema({
      user: {
        type: Schema.Types.ObjectId, // combine by id
        ref: "users" //existing model reference
      },
      company: {
        empNo: {
          type: Number,
          required: true
        },
        status: {
          type: String,
          required: true
        },...
      },
      personal: {
        gender: {
          type: String
        },
        dob: {
          type: Date
        },...
      },
      skills: {
        type: [String],
        required: true
      },
      experience: [
        {
          title: {
            type: String,
            required: true
          },
          company: {
            type: String,
            required: true
          },
          location: {
            type: String
          }...
        }
      ],
      education: [
        {
          school: {
            type: String,
            required: true
          },
          degree: {
            type: String,
            required: true
          },
          specialization: {
            type: String
          },..
        }
      ],
      social: {
        twitter: {
          type: String
        },
        facebook: {
          type: String
        },
        linkedin: {
          type: String
        },...
      }
    });
    

    例如:如果我给linkedin url,如果它应该在社交linkedin中搜索,如果我给c,它应该在技能数组中搜索

    0 回复  |  直到 6 年前