Skip to content

Instantly share code, notes, and snippets.

View mseegers's full-sized avatar

mseegers mseegers

View GitHub Profile
@mseegers
mseegers / mongooseprojectiontest.js
Created February 5, 2013 00:44
Test case for mongoose 3.5.4 that fails saving a subdocument retrieved via projection when saving. Saves to the wrong array element.
var mongoose = require('mongoose');
mongoose.set('debug', true);
var mongooseConnection = mongoose.createConnection('mongodb://localhost/mongooseprojectiontest');
var SubDocSchema = new mongoose.Schema({
someValue: { type: Number },
},{
versionKey: false
});
@mseegers
mseegers / mongoosepulltest.js
Created January 19, 2013 23:19
Testing pull command on sub document array in mongoose 3.5.4. There seems to be an order dependent issue when making other modifications to the same sub document array.
var mongoose = require('mongoose');
mongoose.set('debug', true);
var mongooseConnection = mongoose.createConnection('mongodb://localhost/mongoosepulltest');
var SubDocSchema = new mongoose.Schema({
someValue: { type: Number },
},{
versionKey: false
});