Skip to content

Instantly share code, notes, and snippets.

@blissdev
Created August 15, 2011 03:52
Show Gist options
  • Save blissdev/1145683 to your computer and use it in GitHub Desktop.
Save blissdev/1145683 to your computer and use it in GitHub Desktop.
exports.updateCollection = function(req, res) {
Collection.update({ _id: req.params.collection }, req.body, {}, function(err, collection) {
res.send(collection);
});
};
var mongoose = require('mongoose')
, Schema = mongoose.Schema
, ObjectId = Schema.ObjectId;
var collectionSchema = new Schema({
hall: ObjectId,
parent: ObjectId,
position: Number,
label: String,
haslayout: { type: Boolean, default: false }
});
module.exports = mongoose.model('Collection', collectionSchema);
{"haslayout":true,"label":"Basement","hall":"4e36466c976e005003000004","_id":"4e4895a913d9adf5f5000006"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment