0
我需要更改出版物中的日期格式,並且想知道它是否可用於Meteor。我非常喜歡這樣做:更改流星出版物中的日期格式
Meteor.publish('foo', function() {
var user = Meteor.users.findOne({_id: this.userId});
if (user) {
var f = Foos.find({organizationId: user.profile.organizationId})
return f.map(function(cx) { cx.createdAt = moment.utc(cx.createdAt).format(); return cx });
}
return [];
});
但如果我這樣做,我得到以下異常:
Exception from sub 2 Error: Publish function returned an array of non-Cursors
你認爲在客戶端上會搞亂小蒙戈? – 2015-02-10 04:42:21
不,完全沒有。 Minimongo不知道日期的性質。例如,您仍應該能夠排序。 – 2015-02-10 05:33:46