随笔分类 -  nosql

摘要:var express = require('express'), mongoose = require('mongoose'); //引入mongoose模块//连接mongodb数据库 nodejs为数据库名称mongoose.connect('mongodb://localhost/nodejs');//获取Schema 以及 ObjectId 对象var Schema = mongoose.Schema, ObjectId = Schema.ObjectId;//创建一个评论Schema(结构&架构) 这里相当于mongodb中的coll 阅读全文
posted @ 2012-07-24 22:22 $walker 阅读(499) 评论(0) 推荐(0)