Embedded Documentsの場合はDocumentに配列とかでも持つから同期的に子要素を取得できる。
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
// commentsをEmbedded Documentsにするパターン
var Blog = new Schema({
title: String,
body: String,Embedded Documentsの場合はDocumentに配列とかでも持つから同期的に子要素を取得できる。
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
// commentsをEmbedded Documentsにするパターン
var Blog = new Schema({
title: String,
body: String,| var request = require('request'); | |
| var targetUrl = 'https://www.aeonnetshop.com/shop/goods/goods.aspx?goods=010500000050104901111122871'; | |
| request.get({ url: targetUrl, jar: true }, function(err, res, body) { | |
| console.log(body); | |
| }); |
| var http = require('http'); | |
| http.createServer(function(req, res) { | |
| var data = ''; | |
| req.on('data', function(chunk) { | |
| data += chunk; | |
| }); | |
| req.on('end', function() { | |
| console.log(data); //=> 'foo!' |
| var connect = require('connect'); | |
| var http = require('http'); | |
| var serveStatic = require('serve-static'); | |
| var stubcell = require('stubcell-middleware'); | |
| var app = connect(); | |
| app.use(serveStatic('public', { index: ['index.html']})); | |
| app.use('/api', stubcell('example.yaml')); | |
| app.listen(3000); |
やりたいこと
| 0 info it worked if it ends with ok | |
| 1 verbose cli [ '/Users/hokamura/node/bin/node', | |
| 1 verbose cli '/Users/hokamura/node/bin/npm', | |
| 1 verbose cli 'link' ] | |
| 2 info using npm@2.5.1 | |
| 3 info using node@v0.12.1 | |
| 4 verbose node symlink /Users/hokamura/node/bin/node | |
| 5 verbose linkPkg /Users/hokamura/tmp/20150326-100731/mypackage | |
| 6 verbose gentlyRm vacuuming /Users/hokamura/node/lib/node_modules/mypackage | |
| 7 verbose gentlyRm vacuuming /Users/hokamura/node/lib/node_modules/mypackage |
A Pen by Kazuhito Hokamura on CodePen.
| // ==UserScript== | |
| // @name gmailUnread | |
| // @namespace http://webtech-walker.com/ | |
| // @author hokaccha (Kazuhito Hokamura) | |
| // @include http://mail.google.com/* | |
| // @description add shortcut key is:unread search query | |
| // ==/UserScript== | |
| (function(){ | |
| document.addEventListener('keypress', function(e){ |
| #!/usr/bin/env perl | |
| use strict; | |
| use warnings; | |
| use utf8; | |
| use Net::Delicious; | |
| # del.icio.us config | |
| my $user = "username"; | |
| my $pass = "password"; |
| #!/bin/sh | |
| pjName=$1 | |
| version=$2 | |
| if [ ! "$pjName" -o ! "$version" ]; then | |
| echo 'usage: sfinit project_name version'; | |
| exit; | |
| fi | |
| if expr "$version" : "^1\.0" >/dev/null; then |