{"id":2425,"date":"2018-08-08T00:00:00","date_gmt":"2018-08-08T00:00:00","guid":{"rendered":"https:\/\/azure.microsoft.com\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview"},"modified":"2023-05-11T15:38:14","modified_gmt":"2023-05-11T22:38:14","slug":"new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview","status":"publish","type":"post","link":"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/","title":{"rendered":"New Azure #CosmosDB JavaScript SDK 2.0 now in public preview"},"content":{"rendered":"<p>The Azure Cosmos DB team is excited to announce <a href=\"https:\/\/github.com\/Azure\/azure-cosmos-js\" target=\"_blank\" rel=\"noopener\">version 2.0 RC<\/a> of the JavaScript SDK for SQL API, now in public preview!<\/p>\n<p>We are excited to get feedback through this RC before general availability, so please try it out and let us know what you think. You can get the <a href=\"https:\/\/www.npmjs.com\/package\/@azure\/cosmos\" target=\"_blank\" rel=\"noopener\">latest version<\/a> through npm with:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"npm install azure cosmos\" height=\"60\" src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/08\/daf4316b-cf96-4e00-a82f-845f2af02211.webp\" title=\"npm install azure cosmos\" width=\"240\"><\/p>\n<h2>What is Azure Cosmos DB?<\/h2>\n<p><a href=\"https:\/\/azure.microsoft.com\/services\/cosmos-db\/\" target=\"_blank\" rel=\"noopener\">Azure Cosmos DB<\/a> is a globally distributed, multi-model database service. It offers turnkey global distribution, guarantees single-digit millisecond latencies at the 99th percentile, and elastic scaling of throughput and storage.<\/p>\n<p>For the <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cosmos-db\/sql-api-introduction\" target=\"_blank\" rel=\"noopener\">SQL API<\/a>, we support a <a href=\"https:\/\/github.com\/Azure\/azure-cosmos-js\" target=\"_blank\" rel=\"noopener\">JavaScript SDK<\/a> to enable development against Azure Cosmos DB from JavaScript and Node.js projects. Version 2.0 of the SDK is written completely in TypeScript, and we\u2019ve redesigned the object model and added support for promises. Let\u2019s dive into these updates.<\/p>\n<h2>New object model<\/h2>\n<p>Based on user feedback, we\u2019ve redesigned the object model to make it easier to interact with and perform operations against Cosmos DB.\u00a0<\/p>\n<p>If you\u2019re familiar with the previous version of the JavaScript SDK, you\u2019ve likely noticed that the entire API surface hangs off DocumentDBClient. While the previous design makes it easy to find the entry point for methods, it also came at the cost of a cluttered IntelliSense experience, as seen below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"DocumentDBClient\" height=\"256\" src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/08\/356512b2-7250-4609-b80e-35c3fd8c1abe.webp\" title=\"DocumentDBClient\" width=\"455\"><\/p>\n<p>We also got feedback that it was difficult to do operations off databases, collections, or documents since each method needed to reference the URL of that resource.\u00a0<\/p>\n<p>To address this, we\u2019ve created a new top level <strong>CosmosClient<\/strong> class to replace <strong>DocumentDBClient<\/strong>, and split up its methods into modular Database, Container, and Items classes.<\/p>\n<p>For example, in the new SDK, you can create a new database, container, and add an item to it, all in 10 lines of code!<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"Create a new database\" height=\"335\" src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/08\/63965962-1475-4fa5-8109-f73b51f4c620.webp\" title=\"Create a new database\" width=\"1364\"><\/p>\n<p>This is called a \u201cbuilder\u201d pattern, and it allows us to reference resources based on the resource hierarchy of Cosmos DB, which is similar to the way your brain thinks about Cosmos DB. For example, to create an item, we first reference its database and container, and call items.create().<\/p>\n<h2>Containers and Items<\/h2>\n<p>In addition, because Cosmos DB supports multiple API models, we\u2019ve introduced the concepts of <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cosmos-db\/faq#what-is-a-container\" target=\"_blank\" rel=\"noopener\">Container and Item<\/a> into the SDK, which replace the previous Collection and Document concepts. In other words, what was previously known as a \u201cCollection\u201d is now called a \u201cContainer.\u201d<\/p>\n<p>An account can have one or more databases, and a database consists of one or more containers. Depending on the API, the container is projected as either a collection (SQL or Azure Cosmos DB for MongoDB API), graph (Gremlin API), or table (Tables API).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"Container and Items\" height=\"357\" src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/08\/4e25d7ac-2d6a-44f5-b190-866804a90a67.webp\" title=\"Container and Items\" width=\"652\"><\/p>\n<h2>Support for promises<\/h2>\n<p>Finally, we\u2019ve added full support for promises so you no longer have write custom code to wrap the SDK yourself. Now, you can use async\/await directly against the SDK.<\/p>\n<p>To see the difference, to create a new database, collection, and add a document in the previous SDK, you would have to do something like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"SDK\" height=\"1566\" src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/08\/d96e45ef-6de6-45f8-afcf-d87a8d499a05.webp\" title=\"SDK\" width=\"1364\"><\/p>\n<p>In the new SDK, you can simply await the calls to Cosmos DB directly from inside an async function, as seen below.<\/p>\n<p>We\u2019ve also added a convenience method <u>createIfNotExists()<\/u> for databases and containers, which wraps the logic to read the database, check the status code, and create it if it doesn\u2019t exist.<\/p>\n<p>Here\u2019s the same functionality, using the new SDK:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"promisesNewImageUseThisOne\" height=\"1614\" src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/08\/b83418d3-0079-4349-9fa5-ac34ccb5f745.webp\" title=\"promisesNewImageUseThisOne\" width=\"2672\"><\/p>\n<h2>Open source model<\/h2>\n<p>The Azure Cosmos DB JavaScript SDK is open source, and our team is planning to do all development in the open. To that end, we will be logging issues, tracking feedback, and accepting PR\u2019s in GitHub.<\/p>\n<h2>Getting started<\/h2>\n<p>We hope this new SDK makes for a better developer experience. To get started, check out our <a href=\"https:\/\/docs.microsoft.com\/azure\/cosmos-db\/create-sql-api-nodejs\" target=\"_blank\" rel=\"noopener\">quick start guide<\/a>. We\u2019d love to hear your feedback! Email <a target=\"_blank\" rel=\"noopener\">cosmosdbsdkfeedback@microsoft.com<\/a> or log issues in our <a href=\"https:\/\/github.com\/Azure\/azure-cosmos-js\/issues\" target=\"_blank\" rel=\"noopener\">GitHub repo<\/a>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"npm install azure cosmos\" height=\"60\" src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/08\/2521a944-f599-4fb1-a8e1-c37b8b24465a.webp\" title=\"npm install azure cosmos\" width=\"240\"><\/p>\n<p>Stay up-to-date on the latest Azure <a href=\"https:\/\/twitter.com\/search?q=%23cosmosdb\" target=\"_blank\" rel=\"noopener\">#CosmosDB<\/a> news and features by following us on Twitter <a href=\"https:\/\/twitter.com\/azurecosmosdb\" target=\"_blank\" rel=\"noopener\">@AzureCosmosDB<\/a>. We are really excited to see what you will build with Azure Cosmos DB!<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Azure Cosmos DB team is excited to announce version 2.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"ms_queue_id":[],"ep_exclude_from_search":false,"_classifai_error":"","_classifai_text_to_speech_error":"","_alt_title":"","footnotes":"","msx_community_cta_settings":[]},"categories":[1473,1485],"tags":[],"audience":[3057,3055,3053,3056],"content-type":[],"product":[1538],"tech-community":[],"topic":[],"coauthors":[421],"class_list":["post-2425","post","type-post","status-publish","format-standard","hentry","category-databases","category-internet-of-things","audience-data-professionals","audience-developers","audience-it-decision-makers","audience-it-implementors","product-azure-cosmos-db"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>New Azure #CosmosDB JavaScript SDK 2.0 now in public preview | Microsoft Azure Blog<\/title>\n<meta name=\"description\" content=\"The Azure Cosmos DB team is excited to announce version 2.0 RC of the JavaScript SDK for SQL API, now in public preview!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"New Azure #CosmosDB JavaScript SDK 2.0 now in public preview | Microsoft Azure Blog\" \/>\n<meta property=\"og:description\" content=\"The Azure Cosmos DB team is excited to announce version 2.0 RC of the JavaScript SDK for SQL API, now in public preview!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/\" \/>\n<meta property=\"og:site_name\" content=\"Microsoft Azure Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/microsoftazure\" \/>\n<meta property=\"article:published_time\" content=\"2018-08-08T00:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-11T22:38:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/08\/daf4316b-cf96-4e00-a82f-845f2af02211.webp\" \/>\n<meta name=\"author\" content=\"Deborah Chen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@azure\" \/>\n<meta name=\"twitter:site\" content=\"@azure\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Deborah Chen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/\"},\"author\":[{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/author\/deborah-chen\/\",\"@type\":\"Person\",\"@name\":\"Deborah Chen\"}],\"headline\":\"New Azure #CosmosDB JavaScript SDK 2.0 now in public preview\",\"datePublished\":\"2018-08-08T00:00:00+00:00\",\"dateModified\":\"2023-05-11T22:38:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/\"},\"wordCount\":678,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/08\/daf4316b-cf96-4e00-a82f-845f2af02211.webp\",\"articleSection\":[\"Databases\",\"Internet of things\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/\",\"url\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/\",\"name\":\"New Azure #CosmosDB JavaScript SDK 2.0 now in public preview | Microsoft Azure Blog\",\"isPartOf\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/08\/daf4316b-cf96-4e00-a82f-845f2af02211.webp\",\"datePublished\":\"2018-08-08T00:00:00+00:00\",\"dateModified\":\"2023-05-11T22:38:14+00:00\",\"description\":\"The Azure Cosmos DB team is excited to announce version 2.0 RC of the JavaScript SDK for SQL API, now in public preview!\",\"breadcrumb\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/#primaryimage\",\"url\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/08\/daf4316b-cf96-4e00-a82f-845f2af02211.webp\",\"contentUrl\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/08\/daf4316b-cf96-4e00-a82f-845f2af02211.webp\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog home\",\"item\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Databases\",\"item\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/category\/databases\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"New Azure #CosmosDB JavaScript SDK 2.0 now in public preview\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/#website\",\"url\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/\",\"name\":\"Microsoft Azure Blog\",\"description\":\"Get the latest Azure news, updates, and announcements from the Azure blog. From product updates to hot topics, hear from the Azure experts.\",\"publisher\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/#organization\",\"name\":\"Microsoft Azure Blog\",\"url\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2024\/06\/microsoft_logo.webp\",\"contentUrl\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2024\/06\/microsoft_logo.webp\",\"width\":512,\"height\":512,\"caption\":\"Microsoft Azure Blog\"},\"image\":{\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/microsoftazure\",\"https:\/\/x.com\/azure\",\"https:\/\/www.instagram.com\/microsoftdeveloper\/\",\"https:\/\/www.linkedin.com\/company\/16188386\",\"https:\/\/www.youtube.com\/user\/windowsazure\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/#\/schema\/person\/c702e5edd662b328b49b7e1180cab117\",\"name\":\"shakir\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/9342c7c05bb16548741bc5cd3a3e3b7ee0c8e746844ad2cc582db5beb5514c6f?s=96&d=mm&r=g7664e653ea371ce16eaf75e9fa8952c4\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9342c7c05bb16548741bc5cd3a3e3b7ee0c8e746844ad2cc582db5beb5514c6f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9342c7c05bb16548741bc5cd3a3e3b7ee0c8e746844ad2cc582db5beb5514c6f?s=96&d=mm&r=g\",\"caption\":\"shakir\"},\"sameAs\":[\"https:\/\/azure.microsoft.com\"],\"url\":\"https:\/\/azure.microsoft.com\/en-us\/blog\/author\/shakir\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"New Azure #CosmosDB JavaScript SDK 2.0 now in public preview | Microsoft Azure Blog","description":"The Azure Cosmos DB team is excited to announce version 2.0 RC of the JavaScript SDK for SQL API, now in public preview!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/","og_locale":"en_US","og_type":"article","og_title":"New Azure #CosmosDB JavaScript SDK 2.0 now in public preview | Microsoft Azure Blog","og_description":"The Azure Cosmos DB team is excited to announce version 2.0 RC of the JavaScript SDK for SQL API, now in public preview!","og_url":"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/","og_site_name":"Microsoft Azure Blog","article_publisher":"https:\/\/www.facebook.com\/microsoftazure","article_published_time":"2018-08-08T00:00:00+00:00","article_modified_time":"2023-05-11T22:38:14+00:00","og_image":[{"url":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/08\/daf4316b-cf96-4e00-a82f-845f2af02211.webp","type":"","width":"","height":""}],"author":"Deborah Chen","twitter_card":"summary_large_image","twitter_creator":"@azure","twitter_site":"@azure","twitter_misc":{"Written by":"Deborah Chen","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/#article","isPartOf":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/"},"author":[{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/author\/deborah-chen\/","@type":"Person","@name":"Deborah Chen"}],"headline":"New Azure #CosmosDB JavaScript SDK 2.0 now in public preview","datePublished":"2018-08-08T00:00:00+00:00","dateModified":"2023-05-11T22:38:14+00:00","mainEntityOfPage":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/"},"wordCount":678,"commentCount":0,"publisher":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#organization"},"image":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/#primaryimage"},"thumbnailUrl":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/08\/daf4316b-cf96-4e00-a82f-845f2af02211.webp","articleSection":["Databases","Internet of things"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/","url":"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/","name":"New Azure #CosmosDB JavaScript SDK 2.0 now in public preview | Microsoft Azure Blog","isPartOf":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/#primaryimage"},"image":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/#primaryimage"},"thumbnailUrl":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/08\/daf4316b-cf96-4e00-a82f-845f2af02211.webp","datePublished":"2018-08-08T00:00:00+00:00","dateModified":"2023-05-11T22:38:14+00:00","description":"The Azure Cosmos DB team is excited to announce version 2.0 RC of the JavaScript SDK for SQL API, now in public preview!","breadcrumb":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/#primaryimage","url":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/08\/daf4316b-cf96-4e00-a82f-845f2af02211.webp","contentUrl":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2018\/08\/daf4316b-cf96-4e00-a82f-845f2af02211.webp"},{"@type":"BreadcrumbList","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/new-azure-cosmosdb-javascript-sdk-2-0-now-in-public-preview\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog home","item":"https:\/\/azure.microsoft.com\/en-us\/blog\/"},{"@type":"ListItem","position":2,"name":"Databases","item":"https:\/\/azure.microsoft.com\/en-us\/blog\/category\/databases\/"},{"@type":"ListItem","position":3,"name":"New Azure #CosmosDB JavaScript SDK 2.0 now in public preview"}]},{"@type":"WebSite","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#website","url":"https:\/\/azure.microsoft.com\/en-us\/blog\/","name":"Microsoft Azure Blog","description":"Get the latest Azure news, updates, and announcements from the Azure blog. From product updates to hot topics, hear from the Azure experts.","publisher":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/azure.microsoft.com\/en-us\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#organization","name":"Microsoft Azure Blog","url":"https:\/\/azure.microsoft.com\/en-us\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2024\/06\/microsoft_logo.webp","contentUrl":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2024\/06\/microsoft_logo.webp","width":512,"height":512,"caption":"Microsoft Azure Blog"},"image":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/microsoftazure","https:\/\/x.com\/azure","https:\/\/www.instagram.com\/microsoftdeveloper\/","https:\/\/www.linkedin.com\/company\/16188386","https:\/\/www.youtube.com\/user\/windowsazure"]},{"@type":"Person","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#\/schema\/person\/c702e5edd662b328b49b7e1180cab117","name":"shakir","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/9342c7c05bb16548741bc5cd3a3e3b7ee0c8e746844ad2cc582db5beb5514c6f?s=96&d=mm&r=g7664e653ea371ce16eaf75e9fa8952c4","url":"https:\/\/secure.gravatar.com\/avatar\/9342c7c05bb16548741bc5cd3a3e3b7ee0c8e746844ad2cc582db5beb5514c6f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9342c7c05bb16548741bc5cd3a3e3b7ee0c8e746844ad2cc582db5beb5514c6f?s=96&d=mm&r=g","caption":"shakir"},"sameAs":["https:\/\/azure.microsoft.com"],"url":"https:\/\/azure.microsoft.com\/en-us\/blog\/author\/shakir\/"}]}},"msxcm_display_generated_audio":false,"msxcm_animated_featured_image":null,"distributor_meta":false,"distributor_terms":false,"distributor_media":false,"distributor_original_site_name":"Microsoft Azure Blog","distributor_original_site_url":"https:\/\/azure.microsoft.com\/en-us\/blog","push-errors":false,"_links":{"self":[{"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/posts\/2425","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/comments?post=2425"}],"version-history":[{"count":0,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/posts\/2425\/revisions"}],"wp:attachment":[{"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/media?parent=2425"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/categories?post=2425"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/tags?post=2425"},{"taxonomy":"audience","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/audience?post=2425"},{"taxonomy":"content-type","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/content-type?post=2425"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/product?post=2425"},{"taxonomy":"tech-community","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/tech-community?post=2425"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/topic?post=2425"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/coauthors?post=2425"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}