Thursday, 11 May 2017

Newly entered field does not inserted in already created collection after updating mongoose schema

I have already created one MongoDB collection using mongoose schema from express web service after some days I found a requirement of a new field in mongoose table so added that field in mongoose schema and try to insert a value of newly added field along with existing fields but it's not get inserted in the newly added document.

So what I have done as a troubleshooting process, I deleted my existing collection totally and then inserted my new document in a collection, Then I found It started working properly. My newly inserted field get inserted into the collection. So Is there any other way to add a new field in MongoDB using mongoose without deleting the whole collection.



via Rohit luthra

No comments:

Post a Comment