import { DbSchema,createDbSchemas } from '@vmm/api';

/**
 * @db 数据 Hello
 * ```ts
 * {
 *    name:string, //名称
 * }
 * ```
 */


export const schemas = createDbSchemas({
  hello:new DbSchema<// 数据库定义:
  {
    name: string;
    worldName: string;
  }>(
    // 数据库创建参数:
    {},
    // 数据库索引:
    {
      name: {
        fields: { name: 1 },
        options: { unique: true, sparse: false, dropDups: true },
      },
    },
  ),
/**
 * 数据库 World
 */
  world : new DbSchema<{
    // 数据库结构
    name: string;
    display: string; //显示名称
  }>(
    {
      // 数据库创建参数
    },
    {
      // 数据库索引定义
      name: {
        fields: { name: 1 },
        options: { unique: true, sparse: false, dropDups: true },
      },
    },
  )

}
)



