Meteor.js database Simple Schema question

68 views Asked by At

I have a collection called Elections which stores each election and all the participants in it. Each election has a field called “numberOfContenders” .

Since each election can have different number of contenders running for a position, I need to have a SimpleSchema which allows for entry of information (name, number of votes received etc) about each contender based on the ‘n’ number of contenders under each election.

I don’t know how I can define the SimpleSchema for the variable bit.

Any help/resources will be deeply appreciated.

1

There are 1 answers

0
Abhishek Maurya On

Have three schemas like this

Election

_id name location date

Contenders

_id name address

Voter

_id name address

ElectionVotes

_id election_id contender_id voter_id