lklepner / socket.io-adapter-mongo

MIT License
11 stars 8 forks source link

Modify collection name ? #10

Closed MatthieuHPP closed 6 years ago

MatthieuHPP commented 6 years ago

Hello,

Many thanks for this nice module, I have tested with socket.io@2. I do have a basic question : how can I modify the name of the collection that is created ?

Matthieu

iangregsondev commented 6 years ago

Yes, I would also like to know this. I thought it might be in the options but it appears it is not.

lklepner commented 6 years ago

I took over administration of this module last spring and until today hadn't tried to customize the collection name.

It looks like the original author intended the options.key value for this purpose - https://github.com/lklepner/socket.io-adapter-mongo#adapteropts

I just tested it and can confirm it writes to the specified collection name. Unfortunately it also throws a MongoDB warning since the options object is also being passed with the key value.

I just pushed a fix that corrects this to the fixKey branch

lklepner commented 6 years ago

Fix tested, merged and released to npm as v2.0.3