MongoDB mongoid 存储文件问题

mobiwolf · September 26, 2012 · Last by Rei replied at September 26, 2012 · 2928 hits

mongoid3 好像不支持 Gridfs 了,内置了,那么怎么存储文件呢?

用神马格式呢?

为什么要用 Gridfs 啊?

@fresh_fish 用 rails 弄了个 web app,接受从手机上传的图片,小图片挺多的。不知道怎么通过 mongoid 存储在 mongodb

直接存文件有什么问题吗?

你说寸在文件系统吗?file 类型吗?有很多,方便吗、。

有什么不方便的,你可以放在多个目录下,避免一个目录下文件过多

直接用 mongo 驱动。

#7 楼 @mobiwolf 这个是非官方驱动,目前不支持 gridfs,所以才导致 mongoid 不支持。

用 10gen 的官方驱动。

You need to Sign in before reply, if you don't have an account, please Sign up first.