{"id":127,"date":"2019-11-06T15:56:23","date_gmt":"2019-11-06T23:56:23","guid":{"rendered":"http:\/\/devblogs.microsoft.com\/cosmosdb\/?p=127"},"modified":"2020-02-20T08:13:38","modified_gmt":"2020-02-20T16:13:38","slug":"azure-cosmos-dbs-api-for-mongodb-now-supports-server-version-3-6","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cosmosdb\/azure-cosmos-dbs-api-for-mongodb-now-supports-server-version-3-6\/","title":{"rendered":"Azure Cosmos DB\u2019s API for MongoDB now supports server version 3.6"},"content":{"rendered":"<p><span style=\"font-family: arial,helvetica,sans-serif; font-size: 14pt;\"><strong>What is Azure Cosmos DB?<\/strong><\/span>\n<span style=\"font-family: arial,helvetica,sans-serif;\"><a href=\"https:\/\/docs.microsoft.com\/azure\/cosmos-db\/introduction\">Azure Cosmos DB<\/a> is a globally distributed, multi-model database service that enables you to read and write data from any Azure region. It offers <a href=\"https:\/\/docs.microsoft.com\/azure\/cosmos-db\/distribute-data-globally\">turnkey global distribution<\/a>,guarantees\u00a0<a href=\"https:\/\/azure.microsoft.com\/support\/legal\/sla\/cosmos-db\/v1_3\/\">single-digit millisecond<\/a> latency at the 99<sup>th<\/sup>\u00a0percentile, 99.999 percent\u00a0<a href=\"https:\/\/docs.microsoft.com\/azure\/cosmos-db\/high-availability\">high availability<\/a>, with <a href=\"https:\/\/docs.microsoft.com\/azure\/cosmos-db\/scaling-throughput\">elastic scaling<\/a>\u00a0of\u00a0<a href=\"https:\/\/docs.microsoft.com\/azure\/cosmos-db\/request-units\">throughput and storage<\/a>.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\"><strong><span style=\"font-size: 14pt;\">Azure Cosmos DB\u2019s API for MongoDB now supports server version 3.6<\/span><\/strong><\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">Azure Cosmos DB\u2019s API for MongoDB now supports MongoDB wire protocol version 6 and server version 3.6.0. Starting October 15th, all new accounts provisioned using Azure Portal will have the option to provision with server version 3.6.0. All existing accounts will continue to be on v3.2 or v3.4 (based on their configuration) and will be fully supported. <\/span><\/p>\n<p><img decoding=\"async\" class=\" wp-image-135 aligncenter\" src=\"http:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2019\/11\/mongo36.jpg\" alt=\"\" width=\"505\" height=\"594\" srcset=\"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2019\/11\/mongo36.jpg 1533w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2019\/11\/mongo36-255x300.jpg 255w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2019\/11\/mongo36-768x903.jpg 768w, https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2019\/11\/mongo36-871x1024.jpg 871w\" sizes=\"(max-width: 505px) 100vw, 505px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif; font-size: 14pt;\"><strong>What is new in v3.6 support?<\/strong><\/span>\n<span style=\"font-family: arial,helvetica,sans-serif;\">Server Version 3.6 includes support for new commands and aggregation pipeline stages added as part of the MongoDB v3.6 release, including but not limited to:<\/span><\/p>\n<ul>\n<li><span style=\"font-family: arial,helvetica,sans-serif;\">Compound indexes<\/span><\/li>\n<li><span style=\"font-family: arial,helvetica,sans-serif;\">ChangeFeed support via ChangeStream API<\/span><\/li>\n<li><span style=\"font-family: arial,helvetica,sans-serif;\">Creating unsharded collections under databases with throughput<\/span><\/li>\n<li><span style=\"font-family: arial,helvetica,sans-serif;\">Aggregation pipeline stages\/operators<\/span><\/li>\n<\/ul>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">In addition to the above features, we have made significant performance improvements for most scenarios. In particular, Group, Count and Skip-Limit have much reduced latency compared to prior releases.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\"><strong><span style=\"font-size: 14pt;\">Compound indexes<\/span><\/strong><\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-142 aligncenter\" src=\"http:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2019\/11\/CompoundIndexes.gif\" alt=\"\" width=\"604\" height=\"300\" \/>\n<span style=\"font-family: arial,helvetica,sans-serif;\">You can now create compound indexes using the createIndex() command from Azure Cosmos DB\u2019s API for MongoDB. Compound indexes give a huge performance boost for queries with:<\/span><\/p>\n<ul>\n<li><span style=\"font-family: arial,helvetica,sans-serif;\">Multiple properties in the Sort() definition<\/span><\/li>\n<li><span style=\"font-family: arial,helvetica,sans-serif;\">Find() and Sort() where the property in the Find() definition is part of Sort()<\/span><\/li>\n<li><span style=\"font-family: arial,helvetica,sans-serif;\"> Find() with multiple properties filter where at least one property filter is equality.<\/span><span style=\"color: #242429; font-family: arial,helvetica,sans-serif;\">(e.g. db.test.find({a:1, b: {$gte: 5}, b: {$lte: 7}}); )<\/span><\/li>\n<\/ul>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\"><strong><span style=\"font-size: 14pt;\">ChangeFeed via ChangeStream API<\/span><\/strong><\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">Azure Cosmos DB change feed provides a sorted list of documents within an Azure Cosmos DB collection in the order in which they were added or modified. This feed can be used to listen for modifications to data within the collection to perform real-time (stream) processing on updates. You can now consume Azure Cosmos DB change feed via the ChangeStream API functionality available in Mongo v3.6. <\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\"><strong><span style=\"font-size: 14pt;\">Unsharded collection under database with throughput<\/span><\/strong><\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-143 aligncenter\" src=\"http:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2019\/11\/UnshardedCollectionUnderDatabaseWithThroughput.gif\" alt=\"\" width=\"643\" height=\"357\" \/><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">With the v3.6 release, we are relaxing the restriction requiring a shard key to be present in all collections created under a database with throughput. You can now create an unsharded collection under a shared throughput database both in \u201cdedicated throughput\u201d or \u201cshared throughput\u201d mode. Please note that the maximum size for unsharded collections is 10 GB.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif; font-size: 14pt;\"><strong>Performance improvements in Aggregation pipeline\/Count\/Skip-limit<\/strong><\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-149 aligncenter\" src=\"http:\/\/devblogs.microsoft.com\/cosmosdb\/wp-content\/uploads\/sites\/52\/2019\/11\/mongo-aggregates.gif\" alt=\"\" width=\"654\" height=\"366\" \/><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">In additional to above features, we have made significant improvements in the Aggregation pipeline (most significantly in the $group stage), Count (with and without a filter) and Skip-Limit. These improvements should result in lower latency for these calls along with reduced Request Charges.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif; font-size: 12pt;\">Please refer to our documentation <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cosmos-db\/mongodb-feature-support-36\">Azure Cosmos DB&#8217;s API for MongoDB (3.6 version): supported features and syntax<\/a> for the full list of supported features and commands.<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\"><strong><span style=\"font-size: 14pt;\">Upgrading existing accounts<\/span><\/strong><\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">Currently, the v3.6 feature set is only available to newly created accounts. Over the course of the next few months, we will be working on adding the ability to upgrade existing accounts to MongoDB Server Version 3.6. <\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\"><strong><span style=\"font-size: 14pt;\">Get started<\/span><\/strong><\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">To get started, create a new account using the Azure Portal, <del>ARM template or Azure CLI<\/del> (<em>Update: we don&#8217;t yet have support for ARM or CLI but are working on it. Will update here<\/em>) and connect to it using your favorite tools. We\u2019d love to hear your feedback as well at askcosmosmongoapi@microsoft.com<\/span><\/p>\n<p><span style=\"font-family: arial,helvetica,sans-serif;\">Stay up-to-date on the latest Azure\u202f<a href=\"https:\/\/twitter.com\/search?q=%23cosmosdb\">#CosmosDB<\/a>\u202fnews and features by following us on Twitter\u202f<a href=\"https:\/\/twitter.com\/azurecosmosdb\">@AzureCosmosDB<\/a>. We are really excited to see what you will build with Azure Cosmos DB<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is Azure Cosmos DB? Azure Cosmos DB is a globally distributed, multi-model database service that enables you to read and write data from any Azure region. It offers turnkey global distribution,guarantees\u00a0single-digit millisecond latency at the 99th\u00a0percentile, 99.999 percent\u00a0high availability, with elastic scaling\u00a0of\u00a0throughput and storage. Azure Cosmos DB\u2019s API for MongoDB now supports server version [&hellip;]<\/p>\n","protected":false},"author":9998,"featured_media":61,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[12,15,13],"tags":[],"class_list":["post-127","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-announcements","category-mongodb-api","category-news"],"acf":[],"blog_post_summary":"<p>What is Azure Cosmos DB? Azure Cosmos DB is a globally distributed, multi-model database service that enables you to read and write data from any Azure region. It offers turnkey global distribution,guarantees\u00a0single-digit millisecond latency at the 99th\u00a0percentile, 99.999 percent\u00a0high availability, with elastic scaling\u00a0of\u00a0throughput and storage. Azure Cosmos DB\u2019s API for MongoDB now supports server version [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/users\/9998"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/comments?post=127"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/posts\/127\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/media\/61"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/media?parent=127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/categories?post=127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cosmosdb\/wp-json\/wp\/v2\/tags?post=127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}