I have a collection of data linked like this
users => doc(Current user) => last_msg => doc => some data
I am not getting the data, I received null every time.
_fireStore
.collection('users')
.doc(currentUserId)
.collection("lase_msg")
.doc("cHxIpGAoxhkRZYo9EjgX")
.get()
.then((DocumentSnapshot documentSnapshot) {
userlstMsg = documentSnapshot.data() as Map<String, dynamic>;
});
this is my code and i am receiving null but i should have this data
cHxIpGAoxhkRZYo9EjgX_msg
"fffffffff"
cHxIpGAoxhkRZYo9EjgX_time
October 27, 2022 at 9:26:05 PM UTC 6
CodePudding user response:
You are having a typo lase_msg
will be last_msg
_fireStore
.collection('users')
.doc(currentUserId)
.collection("last_msg") //here
.doc("cHxIpGAoxhkRZYo9EjgX")
.get()