handleAddRoom(newRoom) { this.roomRef.push({ name: newRoom, owner: this.props.user.displayName, ownerId: this.props.user.uid, creationDate: Date.now(), }).then(data => { this.showAlert() }) }
addTodo() { if (this.state.newTodo !== '') { this .itemsRef .push({todo: this.state.newTodo}); this.setState({newTodo: ''}); } }
fs.readFile('./store.json',function(err,data){ if(err) throw err; var file = JSON.parse(data); for(var i=0;i<file.length;i++) { db.push(file[i]); console.log('Store No '+i); } });
export function addComment(param) { return function (dispatch) { let path = "/Comments/" + param.title; firebase.database().ref(path).push(param.comment) } }
const addToFavoriteQuotes = quote => { return firebase.database().ref(QUOTES_COLLECTION).push(quote); }
const addReview = (review) => { review.userId = user.id; review.placeId = parseInt(review.placeId); const reviewRef = database.ref(getPlaceDetailUri(review.placeId)) .child('reviews') .push(review); return reviewRef.then(() => { review.id = reviewRef.key; return review.id; }); }
onNoteSaved() { const userNotesRef = firebaseApp.database().ref(`users/${this.props.user.uid}/notes`); const { note } = this.state; userNotesRef.push({ note }); console.log('save note button pressed'); }
const addDestination = (destination) => { destination.order = ++user.nextDestinationPosition; const destinationsRef = database.ref(getActualUserUri()) .child('destinations') .push(destination); const destinationKey = destinationsRef.key; return destinationsRef .then((snapshot) => { destination.id = destinationKey; }); }
onAddMessage(event) { event.preventDefault(); database.ref('messages').push(this.input.value); this.input.value = ''; }
export function saveImage(id, thumb, title, fullImage) { return () => pictureCollections.push({ id: id, thumb: thumb, title:title, fullImage: fullImage }); }
fs.readFile('./product.json',function(err,data){ if(err) throw err; var file = JSON.parse(data); for(var i=0;i<file.length;i++) { db.push(file[i]); } });
const pushData = (endpoint,data) => { return firebase.database().ref(endpoint).push(data); }
fs.readFile('./product.json',function(err,data){ if(err) throw err; var file = JSON.parse(data); for(var i=0;i<file.length;i++) { db.push(file[i]); } });
const pushData = (endpoint, data) => { return firebase .database() .ref(endpoint) .push(data); }
const pushData = (endpoint, data) => { return firebase .database() .ref(endpoint) .push(data); }