问题很简单。我想创建一个包含集合的文档。另一种措辞方式是我需要在文档中创建一个集合。
我需要能够在 React 中做到这一点。
视觉:集合->文档->集合
这是我需要添加代码的地方:
const addUser = async () => {
await addDoc(usersCollectionRef, {
name: newName,
grade: Number(newGrade),
role: newRole,
hours: Number(newHours),
//Collection Creation should go here as this is where I am making the new document.
})
}
Run Code Online (Sandbox Code Playgroud)
注意:这是反应而不是反应本机