Tabnine Logo For Javascript
@azure/cosmos
Code IndexAdd Tabnine to your IDE (free)

How to use @azure/cosmos

Best JavaScript code snippets using @azure/cosmos(Showing top 5 results out of 1,395)

origin: prashanthmadi/sqlapi-cosmos-nodejs

// client.getDatabaseAccount().then((result)=> console.log(result));

async function createDatabase(database) {
  // make sure to scope return type to database
  const { database: db } = await client.databases.createIfNotExists({ id: database });
  this.db = db;
  console.log("created db");
}
origin: prashanthmadi/sqlapi-cosmos-nodejs

async function offerDetails() {
  const { result: offers } = await client.offers.readAll().toArray();
  _.map(offers, function (item) { console.log(item.resource + " -> " + item.content.offerThroughput) });
}
origin: yannify/react_node_azure_adb2c_cosmos_example

// static methods used at the class level
 static async find() {
  // query to return all items
  const querySpec = {
   query: 'SELECT * FROM root r WHERE r.country = @country',
   parameters: [
    {
     name: '@country',
     value: 'usa'
    }
   ]
  }

  const { resources: results } = await container.items.query(querySpec).fetchAll();
  return results;
 }
origin: prashanthmadi/sqlapi-cosmos-nodejs

client.getWriteEndpoint().then((result) => console.log("Write Endpoint => "+result));
origin: prashanthmadi/sqlapi-cosmos-nodejs

client.getReadEndpoint().then((result) => console.log("Read Endpoint => "+result));
@azure/cosmos(npm)

Most used @azure/cosmos functions

  • Container.items
  • CosmosClient.databases
  • CosmosClient.getReadEndpoint
  • CosmosClient.getWriteEndpoint
  • CosmosClient.offers
  • Items.query,
  • Offers.readAll,
  • QueryIterator.fetchAll,
  • QueryIterator.toArray,
  • offerThroughput

Popular in JavaScript

  • request
    Simplified HTTP request client.
  • readable-stream
    Streams3, a user-land copy of the stream library from Node.js
  • moment
    Parse, validate, manipulate, and display dates
  • winston
    A logger for just about everything.
  • bluebird
    Full featured Promises/A+ implementation with exceptionally good performance
  • async
    Higher-order functions and common patterns for asynchronous code
  • rimraf
    A deep deletion module for node (like `rm -rf`)
  • cheerio
    Tiny, fast, and elegant implementation of core jQuery designed specifically for the server
  • q
    A library for promises (CommonJS/Promises/A,B,D)
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now