duyluonglc / lucid-mongo

Mongodb ODM for adonis framework
327 stars 60 forks source link

Database.collection is not a function #245

Open fereinaux opened 4 years ago

fereinaux commented 4 years ago

Hello everyone, i don't know if that is the place to talk about it, because i'm surelly doing something wrong, but i didn't find a forum or something on stack overflow...

Here's the deal, i just got started developping with Mongo and i already have an AdonisJS app using mssql, so i followed this steps: https://forum.adonisjs.com/t/adonis-multiple-database/4596/7 to connect it to multiple databases, but i got stuck with this error and i think it is with my connection string to mongodb, but in a mongoose example it worked, so if anyone can help me :) :)

mongodb: { client: 'mongodb', connectionString: 'mongodb+srv://reinaux:r(mypassword)@cluster0-b1ikh.gcp.mongodb.net/test?retryWrites=true&w=majority' },