N1QL JOIN / NEST currently require that one document be able to produce the primary key of the other document. Are the contest_names related to the contest_id’s? Are the contest_names unique per contest?
Or can the contests reference the elections?
For arbitrary joins, without any restriction on keys or relationships, stay tuned 