FDM ignores document id

I am restoring data using FDM and to my surprise all the data is being generated with new references. The ref.@ref.id values in the source documents are being solemnly ignored.

The source documents look fine, the JSON data makes sense to me.

The destination database is always clean (no documents, but collections, roles, udfs and schemas defined) before I run FDM


at source:

 { "ref":{"@ref":{"id":"283815732372832769","collection":{"@ref":{"id":"User","collection":{"@ref":{"id":"collections"}}}}}}, "ts": 1606926624910000, "fauna":1, "data": {"username":"9f834127ce86cb5a","email":"9f834127ce86cb5a@getnada.com" } }

at destination:

{
  ref: Ref(Collection("User"), "283824660951339527"),
  ts: 1606935139618000,
  data: { username: "9f834127ce86cb5a", email: "9f834127ce86cb5a@getnada.com" }
}

@zvictor Can you please share more details on how you are exporting and importing using FDM?
Also, you can format in props file to use the existing field as ID or REF. More info here.

I am running the commands Export a Fauna database to a directory followed by Import JSON or CSV documents into a Fauna database. The only difference is that I am running the docker version of them, which provides the same results as the non docker version.

Export:

docker run --rm -v $(pwd)/data:/data zvictor/fauna-data-manager -source key="${FAUNA_SECRET}" -dest path=/data

Import:

docker run --rm -v $(pwd)/data:/data zvictor/fauna-data-manager -source path=/data -dest key="${FAUNA_SECRET}"

And I don’t get your suggestion to use Format transformations… Isn’t the exported data by FDM already compatible with its import transformer? Or do I need to tell FDM how to process its own data?

We are talking about keeping the original ref.@ref.id, no customisations involved.