Storing images in mongoDB



Tried following guide to store images in MonogDb

But still cant get it to work.

Argument 1 passed to Gaufrette\Adapter\GridFS::__construct() must be an instance of MongoDB\GridFS\Bucket, instance of MongoGridFS given

My services.yaml (sorry for missing indentation)

class: Doctrine\MongoDB\GridFS
public: false
arguments: [App\Document\Product\Image]
factory: [’@doctrine.odm.mongodb.document_manager’, getDocumentCollection]
class: MongoGridFS
factory: [’@app.gaufrette_loader.doctrine_grid_fs’, getMongoCollection]

Maybe there are some more dependencies to get this working since phpstorm says ‘doctrine.odm.mongodb.document_manager’ service is missing, or cookbook is a little out of date? :confused:

Also i am using annotation mapping, could it be that ‘App\Document\Product\Image’ just have wrong mapping?

Any help or links to right documentation are appreciated.