I am trying to insert an array of 26 items in my mongodb database using following code:
const items = [item1, item2, ....., item26]
Model.remove({}).then(() => Model.insertMany(items));
When I run this for a local database, the order of items in the collection is as expected. But when I change my connection to a remote m-lab database, the items are not in a correct order in the database. It becomes something like item13...item26, item1...item12
.
PS: I am doing this to run some tests.