Search code examples
faunadb

Populate Ref of FaunaDB Collection


I would like to populate or lookup of ref (Stored id of other collection in record) How I can populate Ref. For Example I have 100000 records on user collection/table like bellow.

[{
  "firstName" : "Rajesh",
  "lastName" : "Gauswami"
  "companyId" : Ref(Collection("company"), "318686180733354176")
},
{
  "firstName" : "Vijay",
  "lastName" : "Gauswami"
  "companyId" : Ref(Collection("company"), "318686180733354177")

}]

Now I would like to know How I can populate company data also with user with Paging.


Solution

  • The Query composition topic in the documentation should be helpful, especially the section titled "Use Let to gather intermediate results".