Reputation: 53
In what order are documents returned for a Select query without an Order by clause?
Example query - SELECT * FROM c WHERE c.type=someType
Is it based on id of the documents or last modified timestamp(_ts) or the timestamp of creation or some random order?
If this info helps - This query is performed in a collection with only one partition whose partitionKey is null, and there are atmost 3 documents for a 'type'
Upvotes: 5
Views: 2357
Reputation: 23767
Is it based on id of the documents or last modified timestamp(_ts) or the timestamp of creation or some random order?
Based on my test, if you do not set any sort rule, it will be sorted as default based on the time created in the database,whatever it is partitioned or not.
In above sample documents, the sort will not be changed if I change the id,partition key(that's name) or ts.
Upvotes: 5