对于Google Cloud DataStore上的现有实体,我想添加一个新属性作为斑点?
对于Google Cloud DataStore上的现有实体,我想为该实体中的所有密钥添加一个新属性“ S11_DATA”。我单击键,然后单击新属性,并适当地命名,并保存和瞧。现在,它是所有密钥的属性列[设置为null]。但是我希望这个属性成为一个斑点(就像一些现有条目一样)。如果我单击现有条目之一,则“ Blob”是属性窗格的下拉菜单中的一个选项。
但这不是新属性的选择。我以为决议是确保关闭索引。但是,不,即使索引未选中,也没有出现斑点选项。
我很乐意通过python设置它是最好的方法,但是我也不能解决这个问题(我可以client.put()
属性值,但找不到如何分配一个属性类型。
表示感谢,
编辑:这是显示“ blob”的下拉菜单=“ https://i.sstatic.net/l2nby.png” alt =“在此处输入图像说明”>
For existing entity on Google Cloud Datastore I would like to add a new property "s11_data" for all of the keys within that entity. I click on a key and click on New Property and name it appropriately, save, and voila. It is now a property column [set to null] for all of the keys. But I want this property to be a Blob (like some of the existing entries are already). If I click one of the existing entries, then "Blob" is an option in the drop-down menu of the property pane.
But it is not an option for the new property. I thought the resolution was to be sure to turn off indexing. But nope, even with Index unchecked the Blob option does not appear.
I'm happy to set it via Python is that is best way forward, but I can't work that out either (I can client.put()
a property value but cannot find how to assign a property type.
Suggestions appreciated. Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您想通过Python在代码中进行此操作,那么如果您使用
dataStore库
(请参阅NDB库
,则 定义(请参阅云NDB库
,也可以在模型定义中定义它(请参阅If you wish to do it in code via Python, then I don't believe
blob
is a property if you're using thedatastore library
(see types). But you can get it as a property if you're using thendb library
bundled ndb library
, then you can set the property type in your model definition (see documentation for property types) e.g.cloud ndb library
, you also define it in model definition (see documentation) e.g.实际上比我想象的要容易。只需写一个字节类,Google自动将其设置为blob
Actually easier than I thought. Just write a bytes class and Google automatically sets it as a Blob