I have a localhost mongodb where collection behavior is proper. But when I try to test this mongorestored collection within a docker container I get in trouble.
All my documents always get inserted into the middle of collection. Example is below:
db.posts.find().pretty()
{
"_id" : ObjectId("595cc2a803297da443e36a1a"),
"name" : "First post",
"__v" : 0
}
{
"_id" : ObjectId("595cc31e03297da443e36a1c"),
"name" : "Second post",
"__v" : 0
}
db.posts.insert({name: "Third post"})
WriteResult({ "nInserted" : 1 })
db.posts.insert({name: "Fourth post})
WriteResult({ "nInserted" : 1 })
db.posts.find().pretty()
{
"_id" : ObjectId("595cc2a803297da443e36a1a"),
"name" : "First post",
"__v" : 0
}
{
"_id" : ObjectId("5964c37ba4e0e8004c4c20d2"),
"name" : "Third post",
"__v" : 0
}
{
"_id" : ObjectId("5964c41fd1302fc68fac6ee0"),
"name" : "Fourth post",
"__v" : 0
}
{
"_id" : ObjectId("595cc31e03297da443e36a1c"),
"name" : "Second post",
"__v" : 0
}