我怎么能存储在MongoDB中与node.js的图像? [英] How can I store images in mongodb with node.js?

查看:329
本文介绍了我怎么能存储在MongoDB中与node.js的图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用当前的应用程序堆栈:

I'm using the current application stack:

的node.js,
MongoDB中,
前preSS(node.js的为)和
猫鼬(node.js的为...使我ORM功能)

node.js, mongodb, express (for node.js), and mongoose (for node.js ... gives me orm capabilities)

我已经习惯了一切,并有定期CRUD的东西的工作。但是,我想不出如何存储二进制/ GridFS的/ BSON东西在蒙戈和检索。

I'm getting used to everything and have the regular CRUD stuff working. However, I can't figure out how to store binary/gridfs/BSON stuff in mongo and retrieve it.

有人可以给我用一个好的node.js的中/蒙戈/鼬或不知道的例子或者知道它可能吗?

Can someone give me an example using node.js/mongo/mongoose or know of a good one or know if its possible?

推荐答案

https://github.com/christkv/node-mongodb-native/blob/master/examples/types.js#L30 列出了下来怎么可以使用添加于节点BSON二进制类型MongoDB的母语。

https://github.com/christkv/node-mongodb-native/blob/master/examples/types.js#L30 lists down how you can add BSON Binary type using the node-mongodb-native.

这篇关于我怎么能存储在MongoDB中与node.js的图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆