Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // method - 1
- let newKey = admin.database().ref().child(`/users/${uid}/stickers/catalog`).push().key;
- let updates = {};
- updates[`/users/${uid}/stickers/catalog/${newKey}`] = {
- state: 'not ready',
- timestamp: (new Date()).toISOString()
- }
- return admin.database().ref().update(updates).then(ret => {
- })
- // method - 2
- let newCatalogItem = admin.database().ref().child(`/users/${uid}/stickers/catalog`).push()
- newCatalogItem.set({
- state: 'wow',
- timestamp: (new Date()).toISOString()
- }).then(_ => {
- let path = newCatalogItem.toString();
- console.log('path: ', path);
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement