Is there anyway to import data that has relationships across collections?
I have 4 related collections - I can upload them individually - using the Data import feature but I can’t see any explanation of how the relationships between documents get imported. Is there a best practice for this?
Currently, the import command in fauna-shell does not support relations during import. This is a known problem, but we have not yet identified a great solution.
Until we do have a solution, you would have to write your own FQL queries to import the data and maintain the relations.
Yes. Two collections cannot share a name, so the collection name is unique in that database. Child, peer, or parent databases might have collections with the same name though.
Match works if you have an appropriate index. If you just want to iterate through all of the documents in a collection, you can use Documents(Collection("collection_name")).
Note that the maximum number of documents per page is 100,000 (default is 64). If you have more documents than that, you’ll need to handle the relationship stitching with multiple queries.