Skip to content

Nonexisiting parents should not be created after export/import #869

@arthabus

Description

@arthabus

Context:
Firestore has a concept of "non-exisitng" nodes in path

For example "collection/nonexsitingdoc/subcollection/doc1"
It's possible to create a doc1 where "nonexsitingdoc" will not existing - in such case firestore UI in browser shows it as greyed out.

Expected behavior

Library doesn't create "nonexsisting" docs after export/import

Actual behavior

Library creates docs that are "nonexsisting" after export/import

Steps to reproduce the behavior

  1. Create a doc under the following path without creating intermediate docs/collections:
    "collection/nonexsitingdoc/subcollection/doc1"
  2. Export the whole collection
  3. Clean up database
  4. Import it back

My usecase

I have a collection of client with the counter in production like this:

Clients: users/{userId}/clients
Client counter: users/{userId}/clients/-counter-doc-/-conter-col-/counter

Both -counter-doc- and -conter-col- don't exisit in the database which is expected

But after exporting and importing to the dev project (for debug and troubleshooting) the lib creates both -counter-doc- and -conter-col-

Now when I fetch client list it also returns -conter-col- document as a client which breaks the internal logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions