Skip to content

Instantly share code, notes, and snippets.

@thihenos
Last active October 10, 2018 18:13
Show Gist options
  • Save thihenos/4c0c66d48988904d21baf4f98ff651e2 to your computer and use it in GitHub Desktop.
Save thihenos/4c0c66d48988904d21baf4f98ff651e2 to your computer and use it in GitHub Desktop.
//JSON of data
let materialKey = db.datastore.key('material');// Chave cloud para a entidade
let material = {
key: materialKey,
data: req.body,
};
db.datastore.save(material).then(function(item) {
console.log('Material ${materialKey.id} created successfully.');
console.log(item[0].mutationResults[0]);//Se você quiser acessar os dados enviado
}, function (error) {
res.status(500).send('Error! '+error);
});//Fim da função save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment