connect-mongo使用简介
来源:互联网 发布:淘宝网限制购买商品 编辑:程序博客网 时间:2024/06/05 04:10
该模块用于将session存入mongo中
https://github.com/kcbanner/connect-mongo
使用方法:
app.use(express.session({ secret: settings.cookie_secret, store: new MongoStore({ db: settings.db }) }));
配置说明:(下一行为上一行的翻译)db
Database name OR fully instantiated node-mongo-native object- db 数据库名称
collection
Collection (optional, default:sessions
)- collection 集合名称,默认为sessions
host
MongoDB server hostname (optional, default:127.0.0.1
)- 数据库地址,默认为本机
port
MongoDB server port (optional, default:27017
)- 数据库端口,默认为27017
username
Username (optional)password
Password (optional)auto_reconnect
This is passed directly to the MongoDBServer
constructor as the auto_reconnect option (optional, default: false).ssl
Use SSL to connect to MongoDB (optional, default: false).url
Connection url of the form:mongodb://user:pass@host:port/database/collection
. If provided, information in the URL takes priority over the other options.mongoose_connection
in the form:someMongooseDb.connections[0]
to use an existing mongoose connection. (optional)stringify
If true, connect-mongo will serialize sessions usingJSON.stringify
before setting them, and deserialize them withJSON.parse
when getting them. (optional, default: true). This is useful if you are using types that MongoDB doesn't support.
0 0
- connect-mongo使用简介
- connect-mongo
- Mongo简介
- connect-mongo模块
- mongo使用
- Mongo使用
- mongo capped collection简介
- node开发之connect-mongo,,express-session
- zeit/micro connect with Mongo by Mongoose
- 使用express-session和connect-mongo实现session管理导致request中session为undefined的问题
- mongo简介——查询
- [Mongo]couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:L112
- mongo 使用 in操作
- mongo使用经验谈
- mongo认识与使用
- mongo第一次使用
- Mongo入门使用(一)
- 使用mongo命令
- nyoj 298 点的变换
- Zstack之例程GenericApp分析笔记2
- VirtualBox的四种网络连接方式
- A + B Problem Too 2101
- Unix环境高级编程:1-2 基础知识、标准化
- connect-mongo使用简介
- UVA - 120 - Stacks of Flapjacks
- 几篇网文利用Block回调,ASIHTTPRequest 实现登录验证
- 我的学习之路—String源码分析
- 为控件绑定监听器
- 爬虫-微信公众平台消息获取
- windows 和 linux 下的Mysql 日志操作
- Love to My Parents
- 基于VxWorks的BSP开发指南