balderdashy/sails

Problem using multiple adapters in a single sails application

Open

#6,956 opened on 2020年2月26日

GitHub で見る
 (2 comments) (0 reactions) (0 assignees)JavaScript (22,778 stars) (1,953 forks)batch import
help wantedmongoormsails-disktry this out please

説明

Node version: 12.10.0 Sails version (sails): 1.2.3 ORM hook version (sails-hook-orm): 2.1.1 Sockets hook version (sails-hook-sockets): 2.0.0 Uploads hook version (sails-hook-uploads): DB adapter & version (e.g. sails-mysql@5.55.5): sails-mongo@1.1.0

and I have 2 models - 1) post 2) comment. Here are the model definitions:

/**
 * Post.js
 */

module.exports = {
  attributes: {
    nameOnMenu: { type: 'string', required: true },
    price: { type: 'string', required: true }
  },

};

and here is the comment model :

/**
 * Comment.js
 */

module.exports = {
  datastore: 'mongo',
  attributes: {
    nameOnMenu: { type: 'string', required: true },
    price: { type: 'string', required: true }
  },
};

so I am trying to connect comment model with mongo adapter and post model to default adapter. But when I run "sails lift", it shows the below error:

alt

What's wrong am I doing?

コントリビューターガイド