I have been using get cockpit for our product building. As our customer base is increasing I have migrated the database to MongoDB also. I have two main concerns after the migration of the database.
When the database is migrated, there are 0 collections in my MongoDb(which is supposed to be true I guess). To create a collection I have to create a POST method to our application using an API we wrote. Even this is fine but if the collection name is ‘employees’ in the cockpit but when I make a POST request it’s creating a collection in MongoDB by name
“collections_employees5e01ae0ce7350”. I want the names to be the same as mentioned in the cockpit.
I have tried another approach by exporting the JSON structure of each collection taken from the cockpit and imported them in MongoDB and successfully created them in MongoDB. But, if I make a POST request for adding a new employee then the data is not going into the collection I have created but creates a new collection again by name “collections_employees5e01ae0ce7350” (like mentioned in Point 1). I tried to rename the collections explicitly in MongoDB using rename. collections method yet the collection name is changed but data is not populated to the renamed collection but again creates a new collection like mentioned above.
If anyone can shed light or help me with this, it will be really helpful for me. I have migrated by changing the config.php file as mentioned on the website.