The Cosmos Javascript API provides a seamless way to build collections that can dynamically adjust their scale

Currently, I am utilizing @azure/cosmos version 3.9.5 to establish a Container and collection within Cosmos DB. My objective is to create a collection with the maxThroughput parameter in order to enable auto-scaling.

comosRefClient.database("sample").containers.createIfNotExists({ id: "samplecoll1", 5000 });

According to the documentation, this should result in creating a collection with Autoscaling set at a maximum RU of 5000. However, the collection is being generated in Manual Mode with 5000 RUs.

I have thoroughly reviewed the documentation and examined the unit testing code from the SDK, both indicating that everything should be functioning correctly.

  1. API - https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/cosmosdb/cosmos/src/client/Container/ContainerRequest.ts
  2. Documentation - https://learn.microsoft.com/en-us/javascript/api/@azure/cosmos/containerrequest?view=azure-node-latest
  3. Unit Testing from SDK - https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/cosmosdb/cosmos/test/public/functional/container.spec.ts

Your assistance with this matter would be greatly appreciated.

Answer №1

My version is the same as yours. I tested out this code snippet and it worked successfully:

const { resource: containerDef } = await client.database("sample").containers.createIfNotExists({ id: "samplecoll1",maxThroughput:5000});

https://i.sstatic.net/AFTHa.png

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Is it possible to apply withStyles to the output of a function?

Currently, I am attempting to add extra styling to the output of a function that returns one of two components based on specific props. Here is an example: import React from 'react' import { withStyles } from '@material-ui/core/styles' ...

Absence of loaders detected in a uniquely crafted npm package

Experiencing an issue with a private npm package loaded from a local git server for use in multiple react applications. When the package is loaded in the application, an error occurs: Error: Module parse failed: Unexpected token (22:6) You may need an app ...

Struggling to add an event listener to the window object in Next.js

Why am I unable to attach an event listener to the window object in nextjs? When attempting to use the 'resize' event, everything functions correctly. However, when trying to utilize the 'load' event, it appears that the event is not be ...

Refresh all $(document).ready(); functions after AJAX has finished loading

I find myself in the midst of customizing an application where my access is limited to just one CSS file and one JS file. Unfortunately, I cannot modify the existing markup or scripts, which leaves me with the challenge of adding my own styles and function ...

Node - Employing the exported function within the current file

While attempting to utilize the function I have exported within the same file, I encounter an undefined error: $(document).ready(function(){ $.get('https://apiEndpoint.com) .done(function(data) { for (var key in data.subscript ...

Eliminate image of variant's dimensions from the slider on Shopify

I am facing an issue with our Shopify store where duplicate variant images for colors are being displayed on the storefront. Although everything looks fine in the dashboard, the duplication is causing confusion for customers. Shopify support has advised ma ...

Retrieve all references to child elements in React

I am working on a component that renders dynamic children, and I need to assign a unique ref to each child (e.g. ref={'childID' + index}) After the children have been loaded, I am looking for a way to loop through them and access their refs. Is ...

Code functions properly on local host but encounters errors when deployed to live server

My comment system was working fine on localhost using PHP, AJAX and JavaScript. However, after transferring my website to a live server, the code does not seem to be functioning properly. Here is an example of the script: <script type="text/javascript ...

Prevent the default scroll event triggered by the mousewheel in certain situations. It is not possible to use preventDefault within a passive event

I have a div element with the onWheel attribute. By default, the browser interprets onWheel as scroll behavior. However, I want to prevent the browser's default mouse behavior under certain conditions. Unfortunately, I encountered an error that say ...

Tips for creating an automatic interval timer reset feature

I searched for similar questions but couldn't find any that helped me. With the assistance of some kind individuals from Stack Overflow, I was able to implement an interval timer sequence on my website. This trailer automatically displays work example ...

The compatibility between cross-fetch and React Native is currently not supported

I have developed an API wrapper that utilizes fetch to carry out the API requests. To ensure compatibility with Browsers, Node, and React Native, I incorporate cross-fetch. When testing the wrapper in Node, everything works fine. However, when using it in ...

Using Yii to attach an onclick event to CLinkPager for every pager link

Is there a way to execute a function with every pager link click in Yii's CLinkPager? I've tried the following code without success. 'pagerCssClass' => 'pagination', 'afterAjaxUpdate'=>"FB.Canvas.scrollTo ...

Tips for creating $http calls in AngularJS

Having some issues with my code, as I'm unsure of the correct placement for making an $http request to a local server. api.js var express = require('express'); var router = express.Router(); var mongoose = require('mongoose'); va ...

Binding textarea data in Angular is a powerful feature that allows

I am looking to display the content from a textarea on the page in real time, but I am struggling to get the line breaks to show up. Here is my current code snippet: app.component.html <div class="ui center aligned grid">{{Form.value.address}}< ...

Dispense CSS using a React element

My React component index.js contains styling in style.css. I am looking to share this component on npm, but I am unsure of how to simplify the process for other developers to use the styling. After exploring different options, I have come across three ap ...

AngularJS xeditable: sending updated data to the server

I am currently utilizing AngularJS to display products in a table for my users. Users have the ability to filter the table using categories or keywords. However, they should also be able to edit the product information within the table, such as product nam ...

By incorporating JavaScript, clicking on an image will trigger a shift in the position of a different element

Just starting out with JavaScript and experimenting with creating an event where clicking on an image triggers the movement of another hidden image. The hidden image is positioned off-screen to the left, while there is a table of images in the center of th ...

Incorporate JavaScript data into your Laravel project

I am having an issue with adding form data to a database using JavaScript. The postData is correctly being read as I can see in an alert message, but the URL is not executing. I have tried it with both 'donorlist' and '/donorlist'. $(d ...

show button after the page has finished loading

I have a button similar to this: <input type="submit" id="product_197_submit_button" class="wpsc_buy_button" name="Buy" value="Add To Cart"> However, I am encountering an issue where if the user clicks the button before all scripts are loaded, an e ...

Coordinating a series of maneuvers

When it comes to coordinating multiple sequential actions in Redux, I find it a bit confusing. I have an application with a summary panel on the left and a CRUD panel on the right. My goal is to have the app automatically update the summary after a CRUD op ...