問題タブ [waterline]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
439 参照

node.js - Sails 0.10 & Many-to-Many association - Get all associated data, not the first only

I have 2 models with a Many-to-Many association. My code to associate these two models is working well (it create a new collection item_languages__language_items with the corresponding documents inside). But then I have trouble to get all the associated data (languages) of a specific item. I'm using MongoDB.

Data stored in the item_languages__language_items collection:

Now in my ItemController.js, I want to get a specific item with all associated languages:

But here I get my item with only 1 associated language, when I expected to get the 3 associated languages.

0 投票する
0 に答える
686 参照

javascript - Sails.JS (ウォーターライン) findAll() の自己参照モデルは空の配列を返します

セイルで自己参照モデルを作成しましたが、いくつかのアイテムを作成しようとすると機能します。しかし、findAll() メソッドに到達すると、空の配列が返されます。自己参照モデルの作成に失敗した可能性があるため、バグではないと思います。とにかく、このモデルが正しければ、Sails.js がアイテムの取得に失敗したとき、どうすれば追跡できますか? 作成と取得には、セイルによって作成された自動ルートを使用します (/:controller/:action)

私のモデル(カテゴリ):

0 投票する
2 に答える
2521 参照

mysql - Sails-mysql データベースが選択されていません

私はこれをかなりグーグルで調べ、スタックオーバーフローに関する他の解決策を見ましたが、私の問題を解決するものは何も見つかりませんでした. ディスクの代わりに mysql を使用するモデルを定義すると、次のエラーが発生します


他の場所で、sails.js (0.9.16) の新しいバージョンには、モデルごとにアダプターと構成を指定する必要がある既知のエラーがあることを読みました。エラーログからわかるように、私はそれを行いましたが、私のモデルのコードは以下のとおりです

私はまだ同じエラーが発生しています。これが私のアプリのpackage.jsonファイルです

私のバージョンの Sails-mysql の package.json ファイル

この問題を解決する方法について何か提案はありますか?