Я использую 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
Как я могу сделать эту работу?