mongodb version 3.0.1
mongoose version 4.0.3
I'm trying to do this:
groupsModel.updateQ({_id:group._id},{
$unset:{"moderators":""},
$set:{"admins":newAdmins}
})
And I'm getting a MongoError from the catch
stating
''$unset' is empty. You must specify a field like so: {$unset: {<field>: ...}}'
But it isn't empty.
moderators
, however, isn't in the schema, which is why I'm trying to remove it.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…