Answer the question
In order to leave comments, you need to log in
How to save to Meteor collection?
Happy new work week everyone.
Tell me, how to save such a construction to the collection in Meteor
en {title : 'Hello'},
ru {title : 'Привет' }
for multilingualism. Template.condSubmit.events({
'submit form': function(e) {
e.preventDefault();
var cond = {
en : title: $(e.target).find('[name=entitle]').val(),
ru : title: $(e.target).find('[name=frtitle]').val()
};
cond._id = Cond.insert(cond);
}
});
Answer the question
In order to leave comments, you need to log in
I don't know anything about Meteor, but in pure js it should be like this:
var cond = {
en: {title: $(e.target).find('[name=entitle]').val()},
ru: {title: $(e.target).find('[name=frtitle]').val()}
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question