use dev_ln_scene;
// ================================================== 创建集合
db.createCollection("GoblinSelfGoodsCategoryVo");
db.createCollection("GoblinStoreGoodsCategoryVo");
db.createCollection("GoblinMgtCategorySpecVo");
db.createCollection("GoblinSelfTagVo");
db.createCollection("GoblinServiceSupportVo");
db.createCollection("GoblinStoreNoticeVo");
db.createCollection("GoblinStoreConfigVo");
db.createCollection("GoblinStoreInfoVo");
db.createCollection("GoblinGoodsInfoVo");
db.createCollection("GoblinGoodsSkuInfoVo");
db.createCollection("GoblinStoreCouponBasicVo");
db.createCollection("GoblinUserCouponVo");

// ================================================== 创建分片
sh.enableSharding("dev_ln_scene");
sh.shardCollection("dev_ln_scene.GoblinSelfGoodsCategoryVo",{"cateId":"hashed"});
sh.shardCollection("dev_ln_scene.GoblinStoreGoodsCategoryVo",{"cateId":"hashed"});
sh.shardCollection("dev_ln_scene.GoblinMgtCategorySpecVo",{"cateId":"hashed"});
sh.shardCollection("dev_ln_scene.GoblinSelfTagVo",{"tagId":"hashed"});
sh.shardCollection("dev_ln_scene.GoblinServiceSupportVo",{"ssid":"hashed"});
sh.shardCollection("dev_ln_scene.GoblinStoreNoticeVo",{"noticeId":"hashed"});
sh.shardCollection("dev_ln_scene.GoblinStoreConfigVo",{"storeId":"hashed"});
sh.shardCollection("dev_ln_scene.GoblinStoreInfoVo",{"storeId":"hashed"});
sh.shardCollection("dev_ln_scene.GoblinGoodsInfoVo",{"spuId":"hashed"});
sh.shardCollection("dev_ln_scene.GoblinGoodsSkuInfoVo",{"skuId":"hashed"});
sh.shardCollection("dev_ln_scene.GoblinStoreCouponBasicVo",{"storeCouponId":"hashed"});
sh.shardCollection("dev_ln_scene.GoblinUserCouponVo",{"ucouponId":"hashed"});

// ================================================== 创建索引
db.GoblinStoreGoodsCategoryVo.createIndex({storeId:"hashed"});
db.GoblinMgtCategorySpecVo.createIndex({cateId:"hashed"});
db.GoblinSelfTagVo.createIndex({tagBelong:"hashed"});
db.GoblinServiceSupportVo.createIndex({ssid:"hashed"});
db.GoblinStoreNoticeVo.createIndex({storeId:"hashed"});
db.GoblinStoreConfigVo.createIndex({storeId:"hashed"});
db.GoblinStoreInfoVo.createIndex({storeId:"hashed"});
db.GoblinGoodsInfoVo.createIndex({spuId:"hashed"});
db.GoblinGoodsInfoVo.createIndex({storeId:"hashed"});
db.GoblinGoodsInfoVo.createIndex({spuNo:"hashed"});
db.GoblinGoodsSkuInfoVo.createIndex({skuId:"hashed"});
db.GoblinGoodsSkuInfoVo.createIndex({storeId:"hashed"});
db.GoblinStoreCouponBasicVo.createIndex({storeCouponId:"hashed"});
db.GoblinUserCouponVo.createIndex({uid:"hashed"});