1. mongoose? elegant mongodb object modeling for node.js
2. quick start: http://mongoosejs.com/docs/index.html
3. Schema, Models ?
- 위 페이지에 가면 아래와 같이 설명하고 있다.
- Schema: Each schema maps to a MongoDB collection and defines the shape of the documents within that collection.
- Models: Models are fancy constructors compiled from our
Schema definitions. Instances of these models representdocuments which can
be saved and retreived from our database. All document creation and retreival
from the database is handled by these models.* 아래와 같이 정리하면 되겠다.
Schema (MongoDB collections)
Models (collection에 mapping 되는 class)
Instances (MongoDB documents)
- schema를 정의하고 이를 Models class로 compile 한 다음 instances를 생성하여 사용하는 개념인데, 굳이 Models라는 클래스를 만들어서 사용하는지는 아직 정리가 안된다. 써 보면서 생각해 볼 일이다.
댓글 없음:
댓글 쓰기