【发布时间】:2018-09-08 02:44:49
【问题描述】:
我在我的应用程序中使用gstore-node
const gstore = require('gstore-node')();
const { Schema } = gstore;
const userSchema = new Schema({
name: { type: String },
userId: String,
});
我想让userId 成为我的key。所以我可以做类似的事情
const userId = '1234';
userSchema.get(userId)
我试过了:
const entityKey = UserSchema.key(userId);
const user = new UserSchema({ key: entityKey });
但是
UserSchema.get(userId); // Not Found
我怎样才能做到这一点?
【问题讨论】:
标签: google-cloud-datastore datastore