1
使用autoform,似乎数据是从autoform传递的,因为我的服务器上的Meteor方法确实获取了数据,但是在我的方法内部进行数据库更新不会更新我的数据库...我错过了什么?流星方法不更新数据库使用Autoform
自动窗体代码...
{{> quickForm collection="Rooms" type="method-update"
doc=this autosave=true id=makeUniqueID
meteormethod="updateRoom"}}
流星方法:
updateRoom: function (room) {
console.log(room);
Rooms.update({_id: room._id}, { $set: {
checkIn: room.checkIn,
checkOut: room.checkOut,
tenantID: room.tenantID,
available: room.available,
needCleaning: room.needCleaning,
}});
},
我的允许/拒绝规则:
Rooms.allow({
insert() { return false; },
update() { return false; },
remove() { return false; }
});
Rooms.deny({
insert() { return true; },
update() { return true; },
remove() { return true; }
});
下面是我从控制台日志中得到我的来自我的流星法。所以我确实得到了更改(在这种情况下,将tenantID和false更改为可用),但它不会在数据库中更新。我错过了一些细节,但在这一点上看不到它。