Skip to content

Instantly share code, notes, and snippets.

-module(crw).
%% -import(random).
-export([start/0]).
-record( mappoint, { row=0,
col=0,
display_char='.',
occupying=[] %% contians all items at this point
}).
var maSchema = new Schema({
name: { type: String, default: 'nameless' }
, age: { type: Number, default: function () { return 0 }}
});
var M = mongoose.model('M', maSchema);
// populate some data ...
M.findOne({..}, { age: 1 }, function (err, m) {