I have the following mongoose schema:
user = {
\"userId\" : \"myId\",
\"connections\":
[{
\"dateConnectedUnix\": 1334567891,
\"is
To use update with ObjectId, you should use ObjectId object instead of string representation :
var ObjectId = require('mongoose').Types.ObjectId;
userAccounts.update({'connections._id': new ObjectId('1234-someId-6789') },
{$pull: { 'connections._id': new ObjectId('1234-someId-6789') }},
function (err,val) {
console.log(val)
});