Closed mkilp closed 6 years ago
@Nop0x as per L86 if you pass same model option
it will reuse previouse registered mongoose model.
To fix it please use different model name as
For categories
require('mongoose-gridfs')({
collection: 'categories',
model: 'CategoryAttachment',
mongooseConnection: db
});
For profile pictures
require('mongoose-gridfs')({
collection: 'profilePictures',
model: 'ProfileAttachment',
mongooseConnection: db
});
So what I want to do are 2 Gridfs Collections: Categories & Profile Pictures
I Insert my files with the following function into the categories bucket:
For the profile pictures I use the exact same syntax but with the collection changed:
However the gridfs system is not recognizing the change and still putting the pictures in the categories bucket.
Is this a possible bug?