I am using a database “AircoKeuzeHulp”, with one multi-reference field to another database “OfferteOnderdelen”.
When I use a query with include(), it stopped returning all the fields, it only returns the standard fields.
When I query the same item directly, I do get all the fields returned.
var offerte = ( await wixData . query ( “Aircokeuzehulp” ). eq ( “_id” , offerteID ) .include(“offerteonderdelen”) . find ()). items [ 0 ];
console . log ( "offerte: " + JSON . stringify ( offerte ));
output doesn’t contain all fields:
offerte:
{"email": "anon",
"achternaam": "anon",
"_id": "414ae9b0-f4ea-498b-ba09-5ecc2bbfc450",
"_owner": "4d36071a-5a44-4bd2-9d8d-0ddc90882710",
"_createdDate": "2022-04-13T13:26:31.260Z",
"_updatedDate": "2022-04-13T13:26:31.260Z",
"offerteonderdelen": [{
"_id": "f974e6b7-30e3-49f2-bf00-18fb11b2929e",
"_owner": "4d36071a-5a44-4bd2-9d8d-0ddc90882710",
"_createdDate": "2022-04-13T13:26:14.354Z",
"_updatedDate": "2022-04-13T13:26:14.354Z"
}],
...
(other fields omitted)
}
var test = (await wixData.query("OfferteOnderdelen").eq("_id", "f974e6b7-30e3-49f2-bf00-18fb11b2929e").find()).items[0];
console.log("test: " + JSON.stringify(test));
output does contain all fields:
test: {
"gekozenModel": "tundra",
"model": "ec515f11-c8a3-415e-9e2a-05f48ffc2cd1",
"_id": "f974e6b7-30e3-49f2-bf00-18fb11b2929e",
"_owner": "4d36071a-5a44-4bd2-9d8d-0ddc90882710",
"_createdDate": "2022-04-13T13:26:14.354Z",
"_updatedDate": "2022-04-13T13:26:14.354Z",
"breedte": "450",
"hoogte": "260",
"lengte": "300",
"ruimte": "slaapkamer",
"onderhoudscontract": true,
"condenspomp": true
}
In the content manager, the reference column also doesnt show the value of the Primary field.
After re-opening the content manager it does:
What could be wrong?