mongoose array push without duplicate
<p>I use the following <code>update</code> command to model:</p>

<pre><code>Room.update({_id: roomId, status: 'live'}, {$push: {"users" : {_id: user._id, loginName: user.loginName}}}, {}, function(err, room) {
</code></pre>

<p>model: </p>

<pre><code>{
    _id: "56c0d9e332f6ddc80ec7271c",
    name: "Reqqqq2",
    creator: "MegaDaddgy",
    status: "live",
    __v: 0,
    users: [
        {
        _id: "56c0a986eeb118741109a45f",
        loginName: "MegaDaddgy"
        },
        {
        _id: "56bf96f56a0c220812f055e6",
        loginName: "Maad"
        }
    ]
}
</code></pre>

<p>I don't want to add duplicate fields to <code>users</code>, How can I do this?</p>