chilts / mongodb-queue

Message queues which uses MongoDB.
209 stars 91 forks source link

How can i connect this with mongoose? #34

Closed luchoCap closed 3 years ago

luchoCap commented 3 years ago

I'm trying to connect mongodb-queue with mongoose but i can't do it. Could you help me? Thanks

mchapman commented 3 years ago

Something like

var mongoose = require('mongoose')
var mongoDbQueue = require('mongodb-queue')
mongoose.connect('mongodb://localhost:27017/mydb',{useNewUrlParser: true})
   .then(() => {
       var queue = mongoDbQueue(mongoose.connection.db, "myQueue");
   })

works

chilts commented 3 years ago

Thanks @luchoCap and @mchapman.