I have my code set up like this
const userCollectionRef = collection(db, 'users');
and then I create the data like this :
const addInfoToDataBase = async () => {
checkLike();
await addDoc(userCollectionRef, {
likePost: userLikes,
username: user,
id: sale_id,
});
};
The way this is setup it generates users> random assigned id value > {id, username, likepost}
I’m trying to change that random assigned id value and assign it a dynamic item that I have called sale_Id. I tried doing this :
const userCollectionRef = collection(db, 'users', sale_id, 'id');
but this creates users> sale_id > id > random assigned id value > {id, username, likepost}
Is it possible to achieve users> sale_id > {id, username, likepost} ?