ADS : 14-rc-42
Platform : Ubuntu 12.04 64 bit
MongoDB : 2.4.4
Using ADS TDE to update fields in a mongodb collection, apparently the docs are fetched in different sort order after clicking 'Save and Refresh' button. So when a user does a search for the updated value on the concerned field using TDE filter, the updated docs are no longer returned, thus giving impression to the user that update did not happen or doc is not present.
Steps to reproduce issue:
1) Load the dataset 'trafficdata.csv.zip' (located at https://docs.google.com/file/d/0B7eDowaj5_6vQTFXNm8wX1hHLXc/edit?usp=sharing) into a collection. (say 'trafficdata')
2) Open the TDE (with max results of 1000), update 'src' field of few documents (preferably at the end of the TDE) and click 'Save and Refresh' button. (Pls refer to attached doc_updation.png)
3) Now search for the updated values using TDE filter. (Pls refer search_kharkov.png)
Actual behavior:
3.a) The updated docs may not be returned.
Expected behavior:
3.b) The updated docs should have been returned for appropriate search term.
4) Now close the TDE and reopen it (with max results set to some high value to surpass the total no of docs).
5) Repeat the search for the docs that were not returned in step (3). This time, those docs will be returned.
|
172 KB
|
81 KB
This is a MongoDB behavior. When a document is updated (especially when the document structure is changed), the document is returned in a different position with MongoDB's default sorting. There is no guarantee that the documents are returned in the same order after an update. If you want the documents to be returned in a specific order, you will need to add a ORDER BY clause.
Once you update the collection SELECT FLATTEN * FROM "traffic_date" is executed and the documents are returned in a different order in the TDE. I had discussed this issue with Jenny and this is accepted for the time being
Once you update the collection SELECT FLATTEN * FROM "traffic_date" is executed and the documents are returned in a different order in the TDE. I had discussed this issue with Jenny and this is accepted for the time being
Issue #10383 |
Closed |
Won't Fix |
Resolved |
Completion |
No due date |
No fixed build |
No time estimate |
This is a MongoDB behavior. When a document is updated (especially when the document structure is changed), the document is returned in a different position with MongoDB's default sorting. There is no guarantee that the documents are returned in the same order after an update. If you want the documents to be returned in a specific order, you will need to add a ORDER BY clause.