score:0
this line will look up the doc which names 'data.user.id'.
.doc(data.user.uid)
if you want to find the result by uid you should use it like
const posts = await firebase.firestore()
.collection("users")
.where('uid', '==', uid)
.get();
rememeber this will return a post collection but a post itself.
update
var usersref = ref.child("users");
usersref.set({
alanisawesome: {
date_of_birth: "june 23, 1912",
full_name: "alan turing"
},
gracehop: {
date_of_birth: "december 9, 1906",
full_name: "grace hopper"
}
});
var hopperref = usersref.child("gracehop");
hopperref.update({
"nickname": "amazing grace"
});
Source: stackoverflow.com
Related Query
- how to update a field on firebase web exactly
- How to update multiple documents in firebase using react Web API
- REACT JS FIREBASE FIRESTORE- how can i update my field in a document?
- How to dynamically update the value for any input field with one event handler function, using hooks
- How to update specific form field in formik when value changes in redux store?
- How to properly update state with Firebase and useEffect()?
- How I can update array field value in redux-form?
- How to update 1 field only without overwriting others fields on a nested Object on React Hooks use Reducer?
- How to update a field value after action dispatched with redux
- How to update the value coming from web socket server in React.js?
- How can i update a name field from single element in array of object from a state in reducer in React-Redux?
- How to use firebase emulators in a react web app
- How to make a field of a document a primary key in firebase
- React - how to update a specific field in Object Array using useState in UseEffect
- How to update state on disabled field in react
- How to update Firebase data to the React application in realtime
- How to update dropdown list field based on another dropdown list in reactjs redux
- How to update react context after pulling data from firebase
- How do I add headers to firebase web app to issue GET request to external API?
- react js firebase firestore- how to update document in sub collection?
- How can I Update Document in Collection firebase
- How do I make material-ui progress bar update with large number of web socket messages causing render to happen often
- How can i update an Input field in Child component from the Parent Component
- how to update the data in firebase database, instead of creating a new data, using reactjs?
- How to prevent child re-render on every parent state update done though input field in React?
- How can I update a field from changing something in a "select" tag in react?
- How to update Firestore field called `likes`. I wanna plus or minus one
- How to update a field in Fauna Database
- How to update the input field when other input field is edited using React useState
- How do I update "read" to true in all the children of messages in firebase database
More Query from same tag
- How can I destructure my array of multiple objects
- Material-UI DataGrid not sorting numeric column correctly
- I want to take out only the numbers
- Trying to debug Adjacent JSX elements error
- Pass props to react-quill handler
- How to do unit testing on inline styling of a component in reactjs?
- Nav bar opens all menus simultaneously upon clicking
- Change state in function component react
- React Drag n Drop PUT request after props
- TS - Reusable API request hook - type not assignable to type 'IUseApiHook'
- React - Passing a method reference between components
- React: how to forward refs to multiple children?
- React does not render when Metamask installed
- how to show error note for only when a particular object value is empty in text field in reactjs
- Why does this log [object Object], [object Object]?
- How to specify handleDayClick of React Day Picker component of a functional component
- How to set an array to empty array when using prevState in Reactjs
- React component does't display options after setting state, firestore returning empty array with object in it? I'm confused
- How to get middlewares from getDefaultMiddleware without deprecation message
- Wrapping React components in other React components that mange behavior props.
- Cannot read property 'map' of undefined with REACTJS
- React styled component not passing props from attribute
- why fails create-react-app with "errno ETIMEDOUT npm ERR! network request"
- Trigger find action in monaco without find panel
- Is it possible to control the uncontrollable input text? - React
- How shared state between separate component in React JS?
- Error: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application
- export default react without mention redundant class
- Reselect - Props undefined in selector
- If/else in FormatJS / React-intl