node-restful icon indicating copy to clipboard operation
node-restful copied to clipboard

connections with multiple mongoose dbs

Open vishvas-agile opened this issue 9 years ago • 1 comments

Hello team,

I want to use multiple connections of mongoose db into my app so node-restful model can not work. All dbs have common schema structure.

var restful = require('node-restful'); var mongoose = require('mongoose'); var Schema = mongoose.Schema;

var connection1 = mongoose.createConnection(uri1); var connection2 = mongoose.createConnection(uri2);

var commonSchema = new Schema({ name : { type : String } });

var user1 = restful.model('log', commonSchema).methods(['get', 'post', 'put', 'delete']); user1.register(app, '/user1');

var user2 = restful.model('log', commonSchema).methods(['get', 'post', 'put', 'delete']); user2.register(app, '/user2');

can you please help me here?

vishvas-agile avatar Jul 02 '16 12:07 vishvas-agile

I think your issue is : https://github.com/baugarten/node-restful/issues/97

asmodehn avatar Oct 11 '16 08:10 asmodehn