我需要如下图所示使用meteorjs。我做了一个样本插入查询来收集并获得当过执行插入query.Please看到下面的代码和错误的错误,并建议我该怎么办?将值插入流星JS中的集合问题?
Error: Method not found [404]
var userid = t.find('#userid').value
, firstname = t.find('#fname').value
, lastname = t.find('#lname').value
, bday = t.find('#bday').value
, bmonth = t.find('#bmonth').value
, byear = t.find('#byear').value;
hcare_users.insert({
userid: userid,
firstname : firstname,
lastname : lastname,
bday: bday,
bmonth : bmonth,
byear : byear
}, function(error, result) {
if (error) console.log ("error ="+ error); //info about what went wrong
if (result) {
console.log ("result="+result);//the _id of new object if successful
$('input[type="text"]').val('');
//$('input[type="radio"]').val('');
//$('input[type="date"]').val('');
alert("Sucessfully Created");
}
});
你可以改一下这个问题吗?我无法解析这个。什么是错误? –
曾经执行时,提示以下错误插入查询将走进sewrver console.Error:未找到方法[404] @基督教弗里茨 – user3214030
你在客户端和服务器端定义您的收藏? 'hcare_users =新Meteor.Collection( 'hcare_users')' –