2017-01-12 4 views
0

私はコレクション「エントリー」は設定していると流星サーバ側のメソッドが定義:流星殻で直接サーバー側のメソッドを呼び出すことはできますか?

import { Meteor } from 'meteor/meteor'; 
import { Mongo } from 'meteor/mongo'; 
import { check } from 'meteor/check'; 

export const Entries = new Mongo.Collection('entries'); 

if (Meteor.isServer) { 
    // This code only runs on the server 
    Meteor.publish('entries', function entriesPublication() { 
     return Entries.find({$or: [ 
     { id_user: this.userId }, 
     ],}); 
    }); 
} 

Meteor.methods({ 
'entries.setPosition'(entryId, position) { 
     check(entryId, String); 
     check(position, Number); 

     Entries.update(entryId, { $set: { position: position } }); 
}); 

それが何らかの形で異なるパラメータで隕石やモンゴシェルでentries.setPosition()を呼び出し、結果を確認することは可能ですか?私は、コンソール上でmongoのクエリ全体を直接書き直したり貼り付けたりすることを避けたいと思っています。どのように関数を実行した後に影響を受けた行を見ることができますか?

+0

なぜノードデバッガを使用しないのですか? https://coderwall.com/p/eqecca/server-debugging-with-meteor –

答えて

0

はい、クライアント側からの呼び出しと同様です。

関連する問題