Last active
October 10, 2018 18:13
-
-
Save thihenos/4c0c66d48988904d21baf4f98ff651e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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