I currently have this basic JS code:
//Set up key, id for datastore request
const id = questionArray[q].id;
const key = ds.key([kind, Number(id)]);
//Create update entity
const modifiedQuestion = {
key: key,
data: {
position: 5,
modifiedAt: new Date().toJSON(),
}
};
let result = await datastore.update(modifiedQuestion);
There is a lot of data stored in the question entity besides "position" and "modifiedAt", but when I run the last line all the data in Datastore gets wiped except for the previous two attributes.
This doesn't exactly seem like an update to me and the documentation for datastore Node.js library is confusing to say the least. Any help would be appreciated!