有谁用过MySQL的Json索引吗
Schema::create('user_profiles', function (Blueprint $table) {
$table->id();
$table->integer('user_id')->index();
$table->string('gender')->index();
$table->string('year')->index();
$table->string('educational')->string();
$table->string('work')->nullable();
$table->string('income')->nullable();
$table->string('height')->index();
$table->json('area'); // ['11', '1101', '']
$table->timestamps();
});
类似这样的area字段,保存的是一个json数组
我要怎么给里面的第一个列创建一个索引
我直接$table->json(‘area’)->index()会报错
另外,我要怎么进行Mode查询
推荐文章: