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
- Proxy介紹
- Reflect介紹
- Azkaban介紹
- 模式介紹模式
- ZooKeeper介紹
- css介紹CSS
- PostgreSQLHooK介紹SQLHook
- DuelJS 介紹JS
- Docker介紹Docker
- StarRocks 介紹
- JCache 介紹
- zigbee 介紹
- GO 介紹Go
- RPC介紹RPC
- springcloud介紹SpringGCCloud
- CSRedisCore 介紹Redis
- AJAX 介紹
- php介紹PHP
- Pyzmq介紹MQ
- uniswap介紹
- LDAP 介紹LDA
- rustyline 介紹Rust
- SpringBoot介紹Spring Boot
- JSON 介紹JSON
- BitMap介紹
- Yocto 介紹
- 自我介紹
- git介紹Git
- FontFamily介紹
- Dubbo介紹
- Duktape 介紹
- jsoncpp 介紹JSON
- 公文介紹
- MySql介紹MySql