MongoDB: remove unique constraint

前端 未结 3 1415
滥情空心
滥情空心 2021-01-04 01:12

I\'m trying the \"Develop a RESTful API Using Node.js With Express and Mongoose\" example and I ran into a problem with the MongoDB Schema:

POST: 
{ title: \         


        
3条回答
  •  北荒
    北荒 (楼主)
    2021-01-04 01:52

    I hope this will helpfull

    db.collection.getIndexes()
    

    Returns an array that holds a list of documents that identify and describe the existing indexes on the collection. now find your index name from list and then removed that index as below

    db.users.dropIndex("your_index_name_here")
    

提交回复
热议问题