Azure cosmosDB(mongoDB), how to disable the automatic indexing in a collection in GO lang or via Shell

huangapple go评论121阅读模式
英文:

Azure cosmosDB(mongoDB), how to disable the automatic indexing in a collection in GO lang or via Shell

问题

我尝试通过mongo shell和我的GO代码手动删除DocumentDBDefaultIndex,但它仍然存在。我不想保留那些默认索引,因为它们会占用不必要的空间;实际上,我只需要一些_id、unique和text索引。

英文:

I tried to delete the DocumentDBDefaultIndex manually through mongo shell and also through my GO code but it still exists. I don't want to have those default indexes lying around which would consume unnecessary space; I actually only need some _id, unique and text indexes.

答案1

得分: 2

似乎Mongo Wire Protocol不支持更改索引策略的功能。如@DavidMakogon所说,请参考文档Azure Cosmos DB如何索引数据?在Azure门户上更改索引策略的设置,如下图所示,或使用REST API 替换集合

希望对您有所帮助。

英文:

It seems that mongo wire protocol does not support the feature of indexing policy change. As @DavidMakogon said, please refer to the document How does Azure Cosmos DB index data? to change the settings of indexing policy on Azure portal as the figure below, or using REST API Replace a Collection.

Azure cosmosDB(mongoDB), how to disable the automatic indexing in a collection in GO lang or via Shell

Hope it helps.

huangapple
  • 本文由 发表于 2017年7月13日 16:41:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/45075598.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定