If Answers
needs to reference a record from Questions
, then you need to obtain that record and include the _id
field in the object you'll insert in Answers
:
var question = Questions.findOne({...criteria...});
Answers.insert({
user: Meteor.userId(),
date: new Date(),
answer: answer,
questionId: question._id
});
Hope this helps. I see "Entries" instead of "Answers" in your question though so you may want to clarify. Also, instead of a separate "Today" collection, you may want to have a separate field in the Questions collection which would mark certain questions as being selected as "Question of the Day".