I want meteor to return all Items that have not been marked as inactive. The inactive flag is just set if the item is marked inactive.
Marking an Item as inactive:
Template.displayedItems.events({
'change [type=checkbox]': function(event) {
var checked = $(event.target).is(':checked');
Items.update(this._id, {$set: {inactive: checked}});
}
How do I have to query to get all items that are not inactive?
如果要获取未设置inactive
字段值的文档,则可以使用$ exists
Items.find({inactive : { $exists: false }})
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.