gpt4 book ai didi

javascript - meteor 出版领域问题

转载 作者:行者123 更新时间:2023-11-28 19:18:25 24 4
gpt4 key购买 nike

我的应用程序在不应该发布的情况下发布了“memberPrice”字段。在我的publish.js 文件中,我指定不发布memberPrice。这是我的 server/publish.js:

Meteor.publish('cars', function() {
return Products.find({category: 'vehicle'}, {limit: 10}, {fields: {memberPrice: 0}});
});

我的 Controller :

carsController = RouteController.extend({
waitOn: function () {

var sessionId = Session.get('sessionId');
console.log("Session: ", sessionId);
Meteor.subscribe('cars');
Meteor.subscribe('cartItems', sessionId);

},
action: function() {
this.render('Cars');
}

});

这是我使用 aldeed:tabular 包的表格:

TabularTables = {};

Meteor.isClient && Template.registerHelper('TabularTables', TabularTables);

TabularTables.Cars = new Tabular.Table({
name: "Cars",
collection: Products,
columns: [
{data: "productCode", title: "Product Code"},
{data: "brand", title: "Brand"},
{data: "productLineName", title: "Product Name"},
{data: "description", title: "Description"},
{data: "memberPrice", title: "Member Price"}

]
});

有谁知道这是怎么回事吗?

谢谢!

最佳答案

您将三个参数传递给 Products.find,但它只需要两个。 {limit: 10}, {fields: {memberPrice: 0}} 应为 {limit: 10, fields: {memberPrice: 0}}

关于javascript - meteor 出版领域问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29396425/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com