This walks the txns queue for updates that affect 'endpointbindings' and remove the 'update' field so that they aren't trying to: "$unset": "bindings."
It does delete the attribute that we want to delete, but the final 'db.txns.update' doesn't succeed because of:
{
"nMatched" : 0,
"nUpserted" : 0,
"nModified" : 0, "writeError" : { "code" : 52, "errmsg" : "The dollar ($) prefixed field '$ne' in 'o.0.a.life.$ne' is not valid for storage."
}
}
So for whatever reason, via golang Juju is able to insert records that have keys that start with "$blah", but I haven't figured out how to modify those same documents via the mongo shell.
I did find a mongodb query to fix the transaction queue if you run into this. You can run something like "dialmgo":
And then from that shell you supposedly could run something like:
db.txns.find({"s": 4, "o.c": "endpointbindings"} function( t) { function( op) {
printjson( op.u); db.txns. update( {_id: t._id}, {$set: {o: t.o}}));
).forEach(
t.o.forEach(
if (op.c == "endpointbindings") {
delete op.u;
}
} );
printjson(
printjson(t._id);
// printjson(t.o);
})
This walks the txns queue for updates that affect 'endpointbindings' and remove the 'update' field so that they aren't trying to: "$unset": "bindings."
It does delete the attribute that we want to delete, but the final 'db.txns.update' doesn't succeed because of:
{
"writeError" : {
"code" : 52,
"errmsg" : "The dollar ($) prefixed field '$ne' in 'o.0.a.life.$ne' is not valid for storage."
"nMatched" : 0,
"nUpserted" : 0,
"nModified" : 0,
}
}
So for whatever reason, via golang Juju is able to insert records that have keys that start with "$blah", but I haven't figured out how to modify those same documents via the mongo shell.