こんにちは自分のページネゴシエーションを実装しようとしていますが、パブリケーションクエリを制限しようとすると次のエラーが発生します。パブリケーションの制限クエリ
Exception from sub Products id Xbd4EW32oob8fBPkk Error: must use ordered observe (ie, 'addedBefore' instead of 'added') with skip or limit
Meteor.publish('Products', function(user, options) {
if (organization && organization.categories) {
//find products in array of categories
let products = Products.find({
categories: {
'$in': organization.categories
}
},
{limit: 10}
);
return products;
} else {
return [];
}
});
サブスクリプションコード:
Router.route('/products', {
name: 'products',
loadingTemplate: 'loading',
waitOn: function() {
// return one handle, a function, or an array
return Meteor.subscribe('Products', {limit: 10});
},
data: function() {
return Products.find({});
},
action: function() {
this.render('ProductCatalog');
}
});
フル・エラートレース:
I20170320-16:29:58.231(0)? Exception from sub Products id vDz4GLRXJ6s3cENeE Error: must use ordered observe (ie, 'addedBefore' instead of 'added') with skip or limit
I20170320-16:29:58.233(0)? at [object Object]._.extend.observeChanges (packages/minimongo/minimongo.js:325:13)
I20170320-16:29:58.234(0)? at [object Object].<anonymous> (packages/omknee:sales-process/sales-process.js:38:31)
I20170320-16:29:58.235(0)? at [object Object]._handler (packages/omknee:access-control/access-control.js:38:31)
I20170320-16:29:58.236(0)? at maybeAuditArgumentChecks (packages/ddp-server/livedata_server.js:1737:12)
I20170320-16:29:58.236(0)? at [object Object]._.extend._runHandler (packages/ddp-server/livedata_server.js:1035:17)
I20170320-16:29:58.237(0)? at [object Object]._.extend._startSubscription (packages/ddp-server/livedata_server.js:853:9)
I20170320-16:29:58.238(0)? at [object Object]._.extend.protocol_handlers.sub (packages/ddp-server/livedata_server.js:625:12)
I20170320-16:29:58.239(0)? at packages/ddp-server/livedata_server.js:559:43
I20170320-16:29:58.246(0)? Auth Strategy - Local. User : {"user":{"email":"[email protected]"},"password":{"digest":"5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8","algorithm":"sha-256"}}
カーソルのどこかで 'observe'を行っているようです。あなたもそのコードを投稿できますか? – jordanwillis
@jordanwillis私はどこでも私のアプリの中で観測を使用していません – MMrj
どのバージョンの流星を使っていますか? – jordanwillis