You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
久しぶりに Mongoose ネタです.Schema の API である static メソッドについて少しだけ. 今回は短め. 見出し 何ができる? 登録した関数内での処理 実際の定義 参考にした情報 何ができる? 例えば User というモデルを定義 (UserSchema) したとします.User に対しては,find/findOne といったメソッドを呼び出すことができます. しかし,例えば DataMapper のような「first_or_create (あれば最初の 1 つを返す,無ければ作って返す)」が欲しくなった場合はどうすればよいでしょう? 上記のような場合に Schema.static メソッドを使用します.Schema.static メソッドは,モデルに対して独自の処理を追加することができます. var UserSchema = new Schema({ name:
Alfred.js is a fast in-process key-value store for node.js. Note that Alfred.js is still very young, so you shouldn't use it on live systems just yet. What does it do?Alfred supports: ODM (Object Document Model)multiple key-value maps in one databaseatomic operations on one recordfinder streamsactivity streamsappend-only filescompactationbuffered and unbuffered writesin-memory indexessortingreplic
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く