Google App Engine DataStore为Web应用程序提供了强大的数据存储解决方案,从而提供灵活性和可扩展性。有时,需要存储具有动态属性的数据,这意味着未提前声明的属性。 This can be achieved in Go by leveraging Google App Engine's PropertyLoadSaver interface.
的propertyList usage
的示例使用propertyList创建一个具有动态属性的实体,请按照以下步骤操作:实现自己的propertyloadsaver(optional)
,您还可以实现自己的propertyloadSaver。这是一个使用称为“ dynent”的自定义类型的示例:”,“ time”:time.now()} //为新实体创建一个不完整的密钥。 k:= datastore.newincompletekey(CTX,“ dynentity”,nil) //使用Dynent保存实体。 键,err:= datastore.put(ctx,k,&d)
免责声明: 提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发到邮箱:[email protected] 我们会第一时间内为您处理。
Copyright© 2022 湘ICP备2022001581号-3