I'm having trouble adding a new field to MongoDB
. The database accepts my Javascript
variable as data, but not as the name for the new field:
function appendInformation(question, answer) {
Sessions.update({ _id: Id }, { question : answer });
}
The correct answer is inserted, but it appears in the document as question: {answer}
instead of {question} : {answer}