0

if I do something like this:

admin.firestore().collection("collection1/doc1/collection2").doc("doc2")

collection1 and doc1 appear as italicized in firestore and they don't seem to be treated as if they exist.

Is there a way to let firebase know that I do in fact want to create these docs/collections as well when I add doc2?

Dan McGrath
  • 41,220
  • 11
  • 99
  • 130
meds
  • 21,699
  • 37
  • 163
  • 314

1 Answers1

2

Think of them as a 'virtual' collection and document when they are italicized. It's because they contain and actual data at the point, only their subcollection does.

Nothing wrong with it being in that state if collection1/doc1 is just to organize the structure.

To make it non-italicized you'll actually have to create the document explicitly.

Dan McGrath
  • 41,220
  • 11
  • 99
  • 130
  • The problem is if I reference one of the italic collections firebase seems to think it doesn't contain anything in the collection even if it does.. – meds Jan 22 '18 at 00:37
  • The collection doesn't contain any documents. I suspect you are misunderstanding something so perhaps post the code you think should do something that isn't? – Dan McGrath Jan 22 '18 at 01:03