Fantasy icon indicating copy to clipboard operation
Fantasy copied to clipboard

请添加 CreteIndex函数的参数,让可以创建唯一索引等

Open kestye opened this issue 8 months ago • 1 comments

在CreateIndex函数中,不能设置option参数,所以不能穿件唯一索引,比如账号等, 请设置参数,让可以传入索引需要的参数 `public async FTask CreateIndex<T>(params object[]? keys) where T : Entity { if (keys == null) { return; }

        List<CreateIndexModel<T>> indexModels = new List<CreateIndexModel<T>>();

        foreach (object key in keys)
        {
            IndexKeysDefinition<T> indexKeysDefinition = (IndexKeysDefinition<T>)key;

            indexModels.Add(new CreateIndexModel<T>(indexKeysDefinition, 这里需要加入option参数));
        }

        await GetCollection<T>().Indexes.CreateManyAsync(indexModels);
    }`

kestye avatar Jul 02 '25 07:07 kestye

收到。

qq362946 avatar Jul 02 '25 23:07 qq362946