【发布时间】:2016-04-12 05:34:46
【问题描述】:
我不熟悉sails Js 和mongodb。我绝对是个新手。
问题: 我的 mongodb 数据库上已经有一个用户集合。我想将它连接到风帆以显示收藏列表。
我看过sails js 文档。我已经安装了sails-mongo 适配器并编辑了connection.js ....
module.exports = {
// this is my model
attributes: {
firstname: {
type: 'string'
}
},
findUser: function(opts,callback){
///// How am I going to connect to mongo and query the users ?
//// user.find('John Doe') wont work here.
}
}
【问题讨论】:
标签: javascript mongodb sails.js nosql