Open mgmonteleone opened 9 years ago
Hi, I think MongoEngine can only connect to one database at a time. You can open a ticket with them at https://github.com/MongoEngine/mongoengine.
MongoEngine has the ability to connect to multiple databases, and then switch that database using an alias (see above), the issue is that the MongoRest always registers the connection as "default" alias. I will take a look at the code to see where this is being done, and perhaps I can come up with a patch to have MongoRest support multiple aliases....
Trying to implement a reporting API for multiple mongo databases with the same structure using mongorest...
Have tried to implement this using the mongoengine connect mechanism:
and then using a variable in my document class: class Products(db.Document): productName = db.StringField() businessUnit = db.StringField() brand = db.StringField() subBrand = db.StringField() franchise = db.StringField() category = db.StringField() subCategory = db.StringField()
But it seams that the db alias is always "default"
Any way to implement this?