输入图片描述
输入图片描述
模式。索引({"$**";text"}(;模式。索引({"名称";文本";});
可以使用
const mongoose = require("mongoose");
const adminSchema = mongoose.Schema(
{
name: { type: String, unique:true }// you can create index here also
}