我需要如下圖所示使用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')' –