-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.4.0
-
Component/s: Test Failure
-
None
Regarding handling lists in Mongo using the Java driver (3.2.2) and mongo db version 3.4
We have been creating a list of strings as follows and storing them in Mongo:
Document result = new Document();
result.put("_id", i);
List<String> list = new ArrayList<>();
list.add("john");
list.add("jack");
result.put("listName", list);
testCollection.insertOne(result);
But, my colleague was testing some code and noticed that the order in one of the items in the list after retrieval from mongo was different than the order that was inserted, but we haven't been able to replicate the issue again.
Is the way we are handling this the right way to do it or do you suggest that we also insert the list order along with the objects?