Azure Cosmos DB
Have feedback for Azure Cosmos DB product? Submit your idea here or upvote other ideas. All feedback is monitored and reviewed by the Azure Cosmos DB team.
This site is for feature suggestions only. For technical questions or issues, please submit them to StackOverflow,where we and the community can better help you.
Please use the following categories when submitting your idea.
Gremlin API: Graph features and capabilities using Gremlin API.
MongoDB API: Features and capabilities using MongoDB API.
Table API: Features and capabilities using Table API.
Etcd API: Features related to using etcd as a configuration store for Kubernetes.
Built-in Notebooks: Features related to built-in Notebooks in Azure Cosmos DB.
SDK: Features related to Azure Cosmos DB SDKs for SQL API.
Change Feed: Features related to Change Feed.
Management: All management features, backup/restore,monitoring, ARM, PowerShell and CLI.
Portal: All features for Azure Portal and Cosmos DB Explorer.
Emulator: Features related to the Azure Cosmos Emulator.
Other: Features not related to any other category.
-
Implement LIKE keyword
Add support for the LIKE '%%' SQL keyword and associated functionality.
863 votesAzure Cosmos DB supports the CONTAINS, STARTSWITH, and ENDSWITH built-in functions which are equivalent to LIKE.
We are planning to add support for LIKE since this is a top requested item, but meanwhile, please use the other equivalent keywords.
-
Support Document Versioning
The ability to generate links to a previous version of a document would be a powerful addition DocumentDB that has many use cases.
In my case I need a self managed profile document that needs to be referenced at point in time to be tied to an event.
797 votesAzure Cosmos DB now provides the ability to access the change feed (https://docs.microsoft.com/en-us/azure/cosmos-db/change-feed). A common pattern to implement eventing patterns is
1. Store every version/change as a separate item
2. Read the change feed to merge/consolidate changes and trigger appropriate actions downstream.You can also expire old versions using TTL: https://docs.microsoft.com/en-us/azure/cosmos-db/time-to-live
-
Add the ability to delete ALL data in a partition
In a partitioned collection, it would be useful to have the option delete all data with a given partitionId.
653 votesWork on this item has started. Will update as this progresses.
Thank you.
-
Add support for single entity retrieval instead of IEnumarable
Single \ First and so are currently not supported in Document DB
For example, the following code:
return client.CreateDocumentQuery<TEntity>(collection.SelfLink).SingleOrDefault(x => x.Id == id);
causes the error:
An exception of type 'Microsoft.Azure.Documents.Linq.DocumentQueryException' occurred in Microsoft.Azure.Documents.Client.dll but was not handled in user code
Additional information: Query expression is invalid, expression return type Entities.Models.Hierarchy is unsupported. Query must evaluate to IEnumerable.
512 votesThank you for your feedback. I have discussed this in more detail with our team.
You are correct the workaround suggested to use .AsEnumerable().FirstOrDefault(). should not be a recommended work around. This way results in materializing all documents on the client first before getting the 1st document, which is not very efficient and the exact opposite of what you are trying to achieve.
Instead we recommend you use Take(1).AsEnumerable() and then .First() or .Single() or .FirstOrDefault() for Single() and First(). Take(1) is translated to SELECT TOP 1 and is processed server-side so more efficient than the previous suggestion and is what you are trying to achieve.
As to the original ask. The support for these operations can be done, but this work is not prioritized against the other work we want to deliver. I will move this back as unplanned but please note this is on our roadmap.
Thanks again…
-
Support ORDER BY on the ST_DISTANCE spatial function
Ordering results by the ST_DISTANCE spatial function is currently not supported.
473 votesThis item was incorrectly marked as started. Actual work on this item has been deferred but is still planned.
Will update when this work is started.
Thank you.
-
Linq provider should respect JsonSerializerSettings ContractResolvers
JsonSerializerSettings are now supported when creating the client, as per https://feedback.azure.com/forums/263030-azure-cosmos-db/suggestions/6422364-allow-me-to-set-jsonserializersettings
However, when using for example a CamelCasePropertyNamesContractResolver to store the data, the linq queries will fail if the properties on the POCO classes are Pascal case.
471 votesThis is currently not on our roadmap. However, we will continue to review this item in the future as we prioritize future releases.
Thank you for your suggestion.
-
Add DateTimeOffset support
The DocumentDb engine should be able to recognize and properly order DateTimeOffset serialized fields.
166 votesNeed feedback if what we announced with this blog post is not what was asked for.
https://devblogs.microsoft.com/cosmosdb/new-date-and-time-system-functions/
-
Support OrderBy and OrderByDescending in Nested Arrays
For example in a document structure such as:
{
"id": "some id",
"things": [{ "value": "5" },
{ "value": "2" },
{ "value: "7" }]
}It would be great to be able to do something like:
queryable.Select(x => x.Things.OrderByDescending(y => y.Value)).AsEnumerable.FirstOrDefault();
159 votesAt this time we will mark this as unplanned. Will keep on our back log and monitor votes for this feature.
Thanks.
-
Compress stored data
Please compress data in place for more efficient use of storage.
For example, I recently exported the entire dataset from a collection and gathered the following stats:
DocumentDB Data Storage: 627 MiB (including hidden fields and other overhead I assume, but not Indexes)
Exported JSON: 461.72 MiB
Compressed JSON: 47MiBSo potentially a 10x saving in data storage size.
114 votesWe’re evaluating more compressed storage formats. Meanwhile, please consider using a client-side compression library for encoding fields/JSON fragments that are not used for querying.
-
Unique indexes on existing collections
Currently, CosmosDB requires unique indexes to be created before inserting data in an empty collection. MongoRestore creates indexes after importing data, which is incompatible with CosmosDB's flow, and forces the user to create unique indexes manually in order to import data. This is impractical for those who require daily imports on several collections. CosmosDB should be able to import data using MongoRestore's flow, by allowing unique indexes to be created after inserting data.
82 votesAfter reviewing we will be moving this to unplanned and will put on our backlog.
Thanks.
-
DISTINCT should use index if possible
Currently one can query distinct values from documents using the DISTINCT keyword like in relational SQL.
Example:
SELECT distinct c.myField FROM c
Related feature request: https://feedback.azure.com/forums/263030-azure-cosmos-db/suggestions/6719531-provide-support-for-distinct
Unfortunately current DISTINCT is rather unusable as it seems to do a full scan even if there is an index present on the field. This feature does save some bandwidth when you really-really-really need this feature, but the RU consumption part is borderline-unacceptable for production use.
Please consider improving the implementation to avoid full scan and use index, if possible.
78 votesWork on this feature has started. Will update again when complete.
-
Compress query results
Compress query results if requested by the client. This could significantly improve network throughput for large queries.
67 votesQuick update. This feature is still in plan. Will look to start work on this in H2 2020.
thanks.
-
Use Order By with Group By
In the documentation for group by (https://docs.microsoft.com/en-us/azure/cosmos-db/sql-query-group-by) you state:
You currently cannot use GROUP BY with an ORDER BY clause but this is planned.
Adding here so we can hopefully get some feedback on its progress and to communicate its importance to the community.
In all my use cases for using group by, I am only interested in returning a subset of the results which without order by I cannot. I must return all results and then order & filter them in the client which is poor from a performance and cost perspective or completely unfeasible depending on…
65 votes -
Support left join
We have a need for the current JOIN mechanism to allow for LEFT JOIN's.
So code like this:
SELECT
c.myId,
(IS_DEFINED(dm.code) ? tm.code : dm.code) as code
FROM c
JOIN dm in c.modelData
JOIN tm in c.modelData
WHERE c.partitionKey="8"
AND dm.dataScope = "default"
and tm.dataScope = "other"on data like this:
[
…{
"myId": "1",
"partitionKey": "8",
"values": [
{
"dataScope": "default",
"code": "1"
},
{
"dataScope": "other",
"code": "1a"
}
],
"id": "ba884879-9b9b-3ff2-dc08-ca6168892ca5"
},
{
"myId": "2",
"partitionKey": "8",
"values": [
{
"dataScope": "default",
"code": "1a"
},
{
"dataScope": "other",
"code": "2"
}
],
"id": "864625c2-50de-5d56-9626-26b04d8ff1f2"
},
{
"myId":31 votesThis work is planned. Tentative start for H2 2020.
Thanks.
-
Filtered unique indexes
I need my unique indexes to work when a soft delete flag is set to zero so that only the active records will participate in the uniqueness constraint per partition. This also makes it easier to determine deleted records in the Change Feed.
26 votesWork for this feature is currently on our backlog and not in our current development cycle plan. We will continue to revisit this item in upcoming cycles and will update here if this item moves in plan.
Thank you for your suggestion and votes.
-
Text search in documentdb with accented characters
I've searched for an answer to this and can't find it...
What I need is support for something like a text-analyzer that allows similar accented characters (e.g. àáâãäå) to match their normal latin equivalent.
So searching for names like "Jose" will return results like "José"23 votesThis is not currently planned, but you can implement this with some code by storing a normalized form of the string (without accents) by using https://msdn.microsoft.com/en-us/library/system.string.normalize.aspx
Please see https://stackoverflow.com/questions/249087/how-do-i-remove-diacritics-accents-from-a-string-in-net for more details.
-
Please add function that can sort array property in document with using like "ORDER BY".
Please add function that can sort array property in document with using like "ORDER BY".
For example,
1.Let's assume we use this query to specify document
( SELECT c.Contents FROM c WHERE c.id = 'id1')
2.And the document is below.
▼Document▼
{
'type': 'Test',
'id': 'id1',
'Contents': [
{
'contentId': 'C1',
'created': '2018-11-21T00:00:00+09:00',
'content': 'content1'
},
{
'contentId': 'C3',
'created': '2018-11-21T17:00:00+09:00',
'content': 'content3'
},
{
'contentId': 'C2',
'created': '2018-11-21T09:00:00+09:00',
'content': 'content2'
}
]
}
3.We want to do is below.
(Sorting array(Messages) by 'created' time)
▼Result We want▼
[
{
'Contents': [
{
'contentId': 'C1',
'created': '2018-11-21T00:00:00+09:00', …21 votesWork for this feature is now planned. Will update when work on this feature starts and when it becomes generally available.
Thank you.
-
Add HAVING clause
Now that group by is supported, if you add having clause functionality, it would be helpful.
21 votesWe have added this feature to our plan for H2 2020. Likely late 2020. Will update when this work starts.
Thank you.
-
Gzip query response
When data is returned from DocumentDb it does not respect the Accept-Encoding header. The DocumentDb SDK actually adds the Accept-Encoding header to the request but DocumentDb ignores it and does not compress the response data. For clients like Mobile (and even API requests) this would be an incredible savings for queries.
21 votesWork for this feature is currently on our backlog and not in our current development cycle plan. We will continue to revisit this item in upcoming cycles and will update here if this item moves in plan.
Thank you for your suggestion and votes.
-
Allow us to define global unique keys across all partitions
Unique keys are scoped to partitions, but this makes it challenging to store data that's supposed to be globally unique like email address or mobile number. I ended up creating a traditional SQL Server table for this, but I'd like to migrate it to Cosmos DB.
19 votesWork for this feature is currently on our backlog and not in our current development cycle plan. We will continue to revisit this item in upcoming cycles and will update here if this item moves in plan.
Thank you for your suggestion and votes.
- Don't see your idea?