Thursday, 13 April 2017

How can i remove a specified field from all documents of a collection using mongoose?

I want to remove key "passwrod" from all documents from users collection using mongoose , is it possible to do it using $unset ?

 { "_id" : ObjectId("58ec890c91b2b612084fd827"),
        "username" : "zain",
        "passwrod" : 123,
        "password" : 8 },
{   "_id" : ObjectId("58ec8918364116187845948d"),
        "username" : "bob",
        "password" : 123,
        "passwrod" : 12  }



via Haris KK

No comments:

Post a Comment