Mongoose介紹
What's Mongoose?
Mongoose is a MongoDB object modeling tool designed to work in an asynchronous environment.
Defining a model is as easy as:
CODE:
var Comment = new Schema({title : String
, body : String
, date : Date
});
var BlogPost = new Schema({
author : ObjectId
, title : String
, body : String
, buf : Buffer
, date : Date
, comments : [Comment]
, meta : {
votes : Number
, favs : Number
}
});
var Post = mongoose.model('BlogPost', BlogPost);
Installation
The recommended way is through the excellent NPM:
$ npm install mongoose
Otherwise, you can check it in your repository and then expose it:
$ git clone git://github.com/LearnBoost/mongoose.git node_modules/mongoose/
And install dependency modules written on package.json.
Then you can require it:
require('mongoose')
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/301743/viewspace-739939/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Mongoose-modified-at 時間自動記錄外掛介紹Go
- mongooseGo
- Mongoose SummaryGo
- mongoose(貓鼬)Go
- mongoose 拾遺Go
- mongoose基本用法Go
- 介紹
- LAMP架構介紹、MYSQL介紹、安裝LAMP架構MySql
- 深入淺出mongooseGo
- mongoose的基本使用Go
- mongoose基礎使用Go
- mongoose中文文件Go
- Mongoose初步學習Go
- mongoose關聯操作Go
- php介紹PHP
- CSRedisCore 介紹Redis
- BitMap介紹
- GeoServer介紹Server
- RabbitMQ 介紹MQ
- 模式介紹模式
- Pyzmq介紹MQ
- Java介紹Java
- css介紹CSS
- kafka介紹Kafka
- 【RESTEasy 介紹】REST
- Kafka 介紹Kafka
- PostgreSQLHooK介紹SQLHook
- nginx介紹Nginx
- 埠介紹
- MongoDB介紹MongoDB
- docker 介紹Docker
- TypeScript介紹TypeScript
- Smbclient介紹client
- JVM 介紹JVM
- Spark介紹Spark
- MQT介紹MQQT
- HttpClient介紹HTTPclient
- 個人介紹