英文:
Setting a slice as noindex in Datastore does not take any effect
问题
给定:
type Person struct {
Name string `datastore:"name"`
Pets []Pet `datastore:"pets,noindex"`
}
type Pet struct {
Age int `datastore:"age"`
}
Datastore仍然会对Pets
字段和Pet
中的所有字段进行索引。
英文:
Given,
type Person struct {
Name string `datastore:"name"`
Pets []Pet `datastore:"pets,noindex"`
}
type Pet struct {
Age int `datastore:"age"`
}
Datastore still indexes Pets
field and all fields in Pet
.
答案1
得分: 1
设置noindex
只会影响新的实体。之前保存的实体将保持索引状态,直到你覆盖它们。
英文:
Setting noindex
will only affect new entities. Entities that have been previously saved will remain indexed until you over-write them.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论