Florian R.
05/29/2024, 9:42 AMconst candidatureCollection = {
name: 'Candidature',
fields: [
{ name: 'id', type: 'string' },
{ name: 'titre', type: 'string' },
{ name: 'benevole', type: 'string', reference: 'Benevole.id' },
{ name: 'annonce', type: 'string', reference: 'Annonce.id' },
],
};
const benevoleCollection = {
name: 'Benevole',
fields: [
{ name: 'id', type: 'string' },
{ name: 'structure', type: 'string', reference: 'Structure.id' },
],
};
const annonceCollection = {
name: 'Annonce',
fields: [
{ name: 'id', type: 'string' },
{ name: 'structure', type: 'string', reference: 'Structure.id' },
],
};
const structureCollection = {
name: 'Structure',
fields: [
{ name: 'id', type: 'string' },
{ name: 'nom', type: 'string' },
],
};
And here is my query on collection Candidature :
{
"q": "*",
"query_by": "titre",
"prefix": true,
"sort_by": "$Annonce($Structure(nom:asc))",
"max_facet_values": 9999,
"page": 1,
"per_page": 10,
"include_fields": "id"
}